svn rev #23407: branches/fast-negotiate/src/lib/crypto/krb/
hartmans@MIT.EDU
hartmans at MIT.EDU
Wed Dec 2 11:16:03 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=23407
Commit By: hartmans
Log Message:
krb5_k_make_checksum: 0 cksumtype means use mandatory cksum for given enctype
Changed Files:
U branches/fast-negotiate/src/lib/crypto/krb/make_checksum.c
Modified: branches/fast-negotiate/src/lib/crypto/krb/make_checksum.c
===================================================================
--- branches/fast-negotiate/src/lib/crypto/krb/make_checksum.c 2009-12-02 16:15:59 UTC (rev 23406)
+++ branches/fast-negotiate/src/lib/crypto/krb/make_checksum.c 2009-12-02 16:16:02 UTC (rev 23407)
@@ -30,6 +30,8 @@
#include "etypes.h"
#include "dk.h"
+/* A 0 checksum type means use the mandatory checksum*/
+
krb5_error_code KRB5_CALLCONV
krb5_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype,
krb5_key key, krb5_keyusage usage,
@@ -44,6 +46,12 @@
krb5_error_code ret;
size_t cksumlen;
+ if (cksumtype == 0) {
+ ret = krb5int_c_mandatory_cksumtype(context, krb5_k_key_enctype(context, key), &cksumtype);
+ if (ret != 0)
+ return ret;
+ }
+
for (i = 0; i < krb5int_cksumtypes_length; i++) {
if (krb5int_cksumtypes_list[i].ctype == cksumtype)
break;
@@ -58,6 +66,7 @@
cksumlen = ctp->hash->hashsize;
cksum->length = cksumlen;
+ cksum->checksum_type = cksumtype;
cksum->contents = malloc(cksum->length);
if (cksum->contents == NULL)
return ENOMEM;
More information about the cvs-krb5
mailing list