* cksumtypes.c (krb5_cksumtypes_list): Add aes128/256 hmacs, with new
authorKen Raeburn <raeburn@mit.edu>
Tue, 24 Jun 2003 02:41:07 +0000 (02:41 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 24 Jun 2003 02:41:07 +0000 (02:41 +0000)
trunc_size field.

* make_checksum.c (krb5_c_make_checksum): If trunc_size is specified, shrink
the computed checksum down to the indicated size.

ticket: 1621
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15650 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/ChangeLog
src/lib/crypto/cksumtypes.c
src/lib/crypto/make_checksum.c

index e15663a07df6415b71c7b9cbe5af1764e6a3c856..0801bb263a58274b4ab2fc6fdea34b3697d9681f 100644 (file)
@@ -1,3 +1,12 @@
+2003-06-23  Ken Raeburn  <raeburn@mit.edu>
+
+       * cksumtypes.c (krb5_cksumtypes_list): Add aes128/256 hmacs, with
+       new trunc_size field.
+
+       * make_checksum.c (krb5_c_make_checksum): If trunc_size is
+       specified, shrink the computed checksum down to the indicated
+       size.
+
 2003-06-05  Sam Hartman  <hartmans@mit.edu>
 
        * string_to_key.c (krb5_c_string_to_key_with_params): Only allow
index 76882f87d128522c62e71de095702fa12ccc8244..ae7ed5f8740f7bc8bfaf82429f2c1c7ba69be469 100644 (file)
@@ -84,6 +84,14 @@ const struct krb5_cksumtypes krb5_cksumtypes_list[] = {
       ENCTYPE_ARCFOUR_HMAC, &krb5int_keyhash_hmac_md5,
       NULL },
 
+    { CKSUMTYPE_HMAC_SHA1_96_AES128, KRB5_CKSUMFLAG_DERIVE,
+      "hmac-sha1-96-aes128", "HMAC-SHA1 AES128 key",
+      0, NULL, 
+      &krb5int_hash_sha1, 12 },
+    { CKSUMTYPE_HMAC_SHA1_96_AES256, KRB5_CKSUMFLAG_DERIVE,
+      "hmac-sha1-96-aes256", "HMAC-SHA1 AES256 key",
+      0, NULL, 
+      &krb5int_hash_sha1, 12 },
 };
 
 const int krb5_cksumtypes_length =
index 5d7be934b5f4b832210554332316702fb2fa76e8..8a384e710a716d8d4a521c9f2b7715891402ec5c 100644 (file)
@@ -108,6 +108,13 @@ krb5_c_make_checksum(context, cksumtype, key, usage, input, cksum)
     if (!ret) {
        cksum->magic = KV5M_CHECKSUM;
        cksum->checksum_type = cksumtype;
+       if (krb5_cksumtypes_list[i].trunc_size) {
+           krb5_octet *trunc;
+           cksum->length = krb5_cksumtypes_list[i].trunc_size;
+           trunc = (krb5_octet *) realloc(cksum->contents, cksum->length);
+           if (trunc)
+               cksum->contents = trunc;
+       }
     }
 
 cleanup: