svn rev #23365: trunk/src/ include/krb5/ lib/crypto/ lib/crypto/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Thu Nov 26 19:00:06 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=23365
Commit By: ghudson
Log Message:
ticket: 6576

Add krb5_k_prf, the krb5_key version of krb5_c_prf.



Changed Files:
U   trunk/src/include/krb5/krb5.hin
U   trunk/src/lib/crypto/krb/prf.c
U   trunk/src/lib/crypto/libk5crypto.exports
Modified: trunk/src/include/krb5/krb5.hin
===================================================================
--- trunk/src/include/krb5/krb5.hin	2009-11-26 23:50:40 UTC (rev 23364)
+++ trunk/src/include/krb5/krb5.hin	2009-11-27 00:00:06 UTC (rev 23365)
@@ -744,6 +744,9 @@
                            const krb5_crypto_iov *data, size_t num_data,
                            krb5_boolean *valid);
 
+krb5_error_code KRB5_CALLCONV
+krb5_k_prf(krb5_context context, krb5_key key, krb5_data *in, krb5_data *out);
+
 #ifdef KRB5_OLD_CRYPTO
 /*
  * old cryptosystem routine prototypes.  These are now layered

Modified: trunk/src/lib/crypto/krb/prf.c
===================================================================
--- trunk/src/lib/crypto/krb/prf.c	2009-11-26 23:50:40 UTC (rev 23364)
+++ trunk/src/lib/crypto/krb/prf.c	2009-11-27 00:00:06 UTC (rev 23365)
@@ -50,17 +50,16 @@
 }
 
 krb5_error_code KRB5_CALLCONV
-krb5_c_prf(krb5_context context, const krb5_keyblock *keyblock,
+krb5_k_prf(krb5_context context, krb5_key key,
 	   krb5_data *input, krb5_data *output)
 {
     const struct krb5_keytypes *ktp;
-    krb5_key key;
     krb5_error_code ret;
 
     assert(input && output);
     assert(output->data);
 
-    ktp = find_enctype(keyblock->enctype);
+    ktp = find_enctype(key->keyblock.enctype);
     if (ktp == NULL)
 	return KRB5_BAD_ENCTYPE;
     if (ktp->prf == NULL)
@@ -69,10 +68,21 @@
     output->magic = KV5M_DATA;
     if (ktp->prf_length != output->length)
 	return KRB5_CRYPTO_INTERNAL;
+    ret = (*ktp->prf)(ktp->enc, ktp->hash, key, input, output);
+    return ret;
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_c_prf(krb5_context context, const krb5_keyblock *keyblock,
+	   krb5_data *input, krb5_data *output)
+{
+    krb5_key key;
+    krb5_error_code ret;
+
     ret = krb5_k_create_key(context, keyblock, &key);
     if (ret != 0)
 	return ret;
-    ret = (*ktp->prf)(ktp->enc, ktp->hash, key, input, output);
+    ret = krb5_k_prf(context, key, input, output);
     krb5_k_free_key(context, key);
     return ret;
 }

Modified: trunk/src/lib/crypto/libk5crypto.exports
===================================================================
--- trunk/src/lib/crypto/libk5crypto.exports	2009-11-26 23:50:40 UTC (rev 23364)
+++ trunk/src/lib/crypto/libk5crypto.exports	2009-11-27 00:00:06 UTC (rev 23365)
@@ -80,6 +80,7 @@
 krb5_k_key_keyblock
 krb5_k_make_checksum
 krb5_k_make_checksum_iov
+krb5_k_prf
 krb5_k_verify_checksum
 krb5_k_verify_checksum_iov
 krb5int_keyhash_md4des




More information about the cvs-krb5 mailing list