diff options
author | Sam Hartman <hartmans@mit.edu> | 2009-12-02 16:16:02 +0000 |
---|---|---|
committer | Sam Hartman <hartmans@mit.edu> | 2009-12-02 16:16:02 +0000 |
commit | 8a5b575f4b992d51fd4175263bfd635826f4c9fc (patch) | |
tree | f596262990902be8664e02aceef2703c3eb050a8 | |
parent | 466d7c02d2f5c795ee00d0291041e8eb18bdd20f (diff) | |
download | krb5-8a5b575f4b992d51fd4175263bfd635826f4c9fc.zip krb5-8a5b575f4b992d51fd4175263bfd635826f4c9fc.tar.gz krb5-8a5b575f4b992d51fd4175263bfd635826f4c9fc.tar.bz2 |
krb5_k_make_checksum: 0 cksumtype means use mandatory cksum for given enctype
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast-negotiate@23407 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/lib/crypto/krb/make_checksum.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/crypto/krb/make_checksum.c b/src/lib/crypto/krb/make_checksum.c index f62f40a..dd279fd 100644 --- a/src/lib/crypto/krb/make_checksum.c +++ b/src/lib/crypto/krb/make_checksum.c @@ -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_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype, 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 @@ krb5_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype, cksumlen = ctp->hash->hashsize; cksum->length = cksumlen; + cksum->checksum_type = cksumtype; cksum->contents = malloc(cksum->length); if (cksum->contents == NULL) return ENOMEM; |