svn rev #22162: branches/fast/src/lib/crypto/ arcfour/
hartmans@MIT.EDU
hartmans at MIT.EDU
Thu Apr 2 23:39:42 EDT 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=22162
Commit By: hartmans
Log Message:
Implement PRF for RC4 enctypes
Changed Files:
U branches/fast/src/lib/crypto/arcfour/arcfour.c
U branches/fast/src/lib/crypto/arcfour/arcfour.h
U branches/fast/src/lib/crypto/etypes.c
Modified: branches/fast/src/lib/crypto/arcfour/arcfour.c
===================================================================
--- branches/fast/src/lib/crypto/arcfour/arcfour.c 2009-04-03 03:39:38 UTC (rev 22161)
+++ branches/fast/src/lib/crypto/arcfour/arcfour.c 2009-04-03 03:39:41 UTC (rev 22162)
@@ -8,6 +8,8 @@
*/
#include "k5-int.h"
#include "arcfour-int.h"
+#include "../hash_provider/hash_provider.h"
+
const char *const krb5int_arcfour_l40 = "fortybits";
void
@@ -304,3 +306,12 @@
return (ret);
}
+ krb5_error_code krb5int_arcfour_prf(
+ const struct krb5_enc_provider *enc,
+ const struct krb5_hash_provider *hash,
+ const krb5_keyblock *key,
+ const krb5_data *in, krb5_data *out)
+ {
+ assert(out->length == 20);
+ return krb5_hmac(&krb5int_hash_sha1, key, 1, in, out);
+ }
Modified: branches/fast/src/lib/crypto/arcfour/arcfour.h
===================================================================
--- branches/fast/src/lib/crypto/arcfour/arcfour.h 2009-04-03 03:39:38 UTC (rev 22161)
+++ branches/fast/src/lib/crypto/arcfour/arcfour.h 2009-04-03 03:39:41 UTC (rev 22162)
@@ -34,5 +34,10 @@
extern const struct krb5_enc_provider krb5int_enc_arcfour;
extern const struct krb5_aead_provider krb5int_aead_arcfour;
+ krb5_error_code krb5int_arcfour_prf(
+ const struct krb5_enc_provider *enc,
+ const struct krb5_hash_provider *hash,
+ const krb5_keyblock *key,
+ const krb5_data *in, krb5_data *out);
#endif /* ARCFOUR_H */
Modified: branches/fast/src/lib/crypto/etypes.c
===================================================================
--- branches/fast/src/lib/crypto/etypes.c 2009-04-03 03:39:38 UTC (rev 22161)
+++ branches/fast/src/lib/crypto/etypes.c 2009-04-03 03:39:41 UTC (rev 22162)
@@ -119,10 +119,10 @@
"ArcFour with HMAC/md5",
&krb5int_enc_arcfour,
&krb5int_hash_md5,
- 0,
+ 20,
krb5_arcfour_encrypt_length, krb5_arcfour_encrypt,
krb5_arcfour_decrypt, krb5int_arcfour_string_to_key,
- NULL, /*PRF*/
+ krb5int_arcfour_prf, /*PRF*/
CKSUMTYPE_HMAC_MD5_ARCFOUR,
&krb5int_aead_arcfour,
0 /*flags*/ },
@@ -131,10 +131,10 @@
"Exportable ArcFour with HMAC/md5",
&krb5int_enc_arcfour,
&krb5int_hash_md5,
- 0,
+ 20,
krb5_arcfour_encrypt_length, krb5_arcfour_encrypt,
krb5_arcfour_decrypt, krb5int_arcfour_string_to_key,
- NULL, /*PRF*/
+ krb5int_arcfour_prf, /*PRF*/
CKSUMTYPE_HMAC_MD5_ARCFOUR,
&krb5int_aead_arcfour,
0 /*flags*/ },
More information about the cvs-krb5
mailing list