Include usage argument in keyed hash provider calls
authorSam Hartman <hartmans@mit.edu>
Mon, 22 Oct 2001 21:05:23 +0000 (21:05 +0000)
committerSam Hartman <hartmans@mit.edu>
Mon, 22 Oct 2001 21:05:23 +0000 (21:05 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13830 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/k5-int.h
src/lib/crypto/ChangeLog
src/lib/crypto/keyhash_provider/ChangeLog
src/lib/crypto/keyhash_provider/descbc.c
src/lib/crypto/keyhash_provider/k5_md4des.c
src/lib/crypto/keyhash_provider/k5_md5des.c
src/lib/crypto/keyhash_provider/t_cksum.c
src/lib/crypto/make_checksum.c

index 3410effc9e1a0fbc0380b42979464cd7a2516068..6aef81d0b960db4c2978e85243b1f358fbbfd3d1 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-22  Sam Hartman  <hartmans@mit.edu>
+
+       * k5-int.h: keyhash_provider gains usage argument to hash function
+
 2001-10-15  Danilo Almeida  <dalmeida@mit.edu>
 
        * krb5.hin (krb5_kt_get_type): KRB5_CALLCONV.
index b7f0c62922af2fcd244a93f7042ee64c25f1a47a..d180e00f31a300c4991cba2962bc904cc6ee94cb 100644 (file)
@@ -550,6 +550,7 @@ struct krb5_keyhash_provider {
     void (*hash_size) (size_t *output);
 
     krb5_error_code (*hash) (krb5_const krb5_keyblock *key,
+                            krb5_keyusage usage,
                             krb5_const krb5_data *ivec,
                             krb5_const krb5_data *input,
                             krb5_data *output);
index 099cbd652d926b1a737f387376e2d28bab44b2e1..d8fbcfc502e432fef53373a71944f2dba5a046b5 100644 (file)
@@ -1,3 +1,14 @@
+2001-10-22  Sam Hartman  <hartmans@mit.edu>
+
+       * make_checksum.c (krb5_c_make_checksum):  Include key usage
+
+2001-10-19  Sam Hartman  <hartmans@mit.edu>
+
+       * Makefile.in (check-unix):  Run t_encrypt
+
+       * t_encrypt.c:  New file to contain generic encryption system
+       black-box tests ; currently primitive,  but useful for rc4 work
+
 2001-10-03  Ken Raeburn  <raeburn@mit.edu>
 
        * block_size.c, checksum_length.c, cksumtype_to_string.c,
index 8a40911a2c27f902c4d8124f6695f31665241fbd..5ca3844da1ae65cdf1fa8f6db1cad0350f8bc345 100644 (file)
@@ -1,3 +1,13 @@
+2001-10-22  Sam Hartman  <hartmans@mit.edu>
+
+       * t_cksum.c (main):  Include key usage in hash call.
+
+       * k5_md5des.c (k5_md5des_hash): add usage
+
+       * k5_md4des.c (k5_md4des_hash):  add key usage
+
+       * descbc.c (k5_descbc_hash):  Add key usage
+
 2001-05-31  Ezra Peisach  <epeisach@mit.edu>
 
        * k5_md4des.c (k5_md4des_verify): Get rid of local variable that
index 0394779e600defa256181b01c401c2c18f296eb5..9682fbb3b0844bfc1d6be48c6278e487877bb424 100644 (file)
@@ -37,7 +37,7 @@ k5_descbc_hash_size(size_t *output)
 }
 
 static krb5_error_code
-k5_descbc_hash(const krb5_keyblock *key, const krb5_data *ivec,
+k5_descbc_hash(const krb5_keyblock *key, krb5_keyusage usage, const krb5_data *ivec,
               const krb5_data *input, krb5_data *output)
 {
     mit_des_key_schedule schedule;
index 8c622055f292586a73e73d5e1f5af4695ee8f069..8e03357d1541e80fb908250a047997b8d85c1523 100644 (file)
@@ -48,7 +48,7 @@ k5_md4des_hash_size(size_t *output)
    that's less efficient, and there's no need for this to be generic */
 
 static krb5_error_code
-k5_md4des_hash(const krb5_keyblock *key, const krb5_data *ivec,
+k5_md4des_hash(const krb5_keyblock *key, krb5_keyusage usage, const krb5_data *ivec,
               const krb5_data *input, krb5_data *output)
 {
     krb5_error_code ret;
index 35b98b4a05a6a789bcf34c2544fa713d66884533..012bc850ca540683c7b86b92bbbdb36e845fd4f5 100644 (file)
@@ -48,7 +48,7 @@ k5_md5des_hash_size(size_t *output)
    that's less efficient, and there's no need for this to be generic */
 
 static krb5_error_code
-k5_md5des_hash(const krb5_keyblock *key, const krb5_data *ivec,
+k5_md5des_hash(const krb5_keyblock *key, krb5_keyusage usage, const krb5_data *ivec,
               const krb5_data *input, krb5_data *output)
 {
     krb5_error_code ret;
index ce9ef23bba94b6d0b031691d820f3692ffb4f8d6..21847c84f3aab0c6073176c77bafc3f9716aac6d 100644 (file)
@@ -102,7 +102,7 @@ main(argc, argv)
     plaintext.length = strlen(argv[msgindex]);
     plaintext.data = argv[msgindex];
 
-    if ((kret = (*(khp.hash))(&keyblock, 0, &plaintext, &newstyle_checksum))) {
+    if ((kret = (*(khp.hash))(&keyblock, 0, 0, &plaintext, &newstyle_checksum))) {
       printf("krb5_calculate_checksum choked with %d\n", kret);
       break;
     }
index db0c7c32aa06f7828a80807b96ee69312788ad02..5d7be934b5f4b832210554332316702fb2fa76e8 100644 (file)
@@ -85,7 +85,7 @@ krb5_c_make_checksum(context, cksumtype, key, usage, input, cksum)
            }
        }
 
-       ret = (*(krb5_cksumtypes_list[i].keyhash->hash))(key, 0, input, &data);
+       ret = (*(krb5_cksumtypes_list[i].keyhash->hash))(key, usage, 0, input, &data);
     } else if (krb5_cksumtypes_list[i].flags & KRB5_CKSUMFLAG_DERIVE) {
        /* any key is ok */
 #ifdef ATHENA_DES3_KLUDGE