Remove the ivec parameters from the keyhash provider functions, as
authorGreg Hudson <ghudson@mit.edu>
Sun, 6 Dec 2009 20:55:16 +0000 (20:55 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sun, 6 Dec 2009 20:55:16 +0000 (20:55 +0000)
they are never used by callers.

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

src/include/k5-int.h
src/lib/crypto/crypto_tests/t_cksum.c
src/lib/crypto/krb/aead.c
src/lib/crypto/krb/keyhash_provider/descbc.c
src/lib/crypto/krb/keyhash_provider/hmac_md5.c
src/lib/crypto/krb/keyhash_provider/k5_md4des.c
src/lib/crypto/krb/keyhash_provider/k5_md5des.c
src/lib/crypto/krb/keyhash_provider/md5_hmac.c
src/lib/crypto/krb/make_checksum.c
src/lib/crypto/krb/verify_checksum.c
src/lib/crypto/krb/verify_checksum_iov.c

index d16642e9e3941f8ebd64dd5653abb04e25d5b447..2047bb98932d06ca59263c46b5732a25d78c8852 100644 (file)
@@ -675,20 +675,17 @@ struct krb5_keyhash_provider {
     size_t hashsize;
 
     krb5_error_code (*hash)(krb5_key key, krb5_keyusage keyusage,
-                            const krb5_data *ivec, const krb5_data *input,
-                            krb5_data *output);
+                            const krb5_data *input, krb5_data *output);
 
     krb5_error_code (*verify)(krb5_key key, krb5_keyusage keyusage,
-                              const krb5_data *ivec, const krb5_data *input,
-                              const krb5_data *hash, krb5_boolean *valid);
+                              const krb5_data *input, const krb5_data *hash,
+                              krb5_boolean *valid);
 
     krb5_error_code (*hash_iov)(krb5_key key, krb5_keyusage keyusage,
-                                const krb5_data *ivec,
                                 const krb5_crypto_iov *data, size_t num_data,
                                 krb5_data *output);
 
     krb5_error_code (*verify_iov)(krb5_key key, krb5_keyusage keyusage,
-                                  const krb5_data *ivec,
                                   const krb5_crypto_iov *data,
                                   size_t num_data, const krb5_data *hash,
                                   krb5_boolean *valid);
index 5aca50f95a96b00d2e41e1e331702bfcade0573e..16a994fdb242e2ee02fc5c8d8ef411c987c5fd71 100644 (file)
@@ -127,13 +127,13 @@ main(argc, argv)
         plaintext.length = strlen(argv[msgindex]);
         plaintext.data = argv[msgindex];
 
-        if ((kret = (*(khp.hash))(key, 0, 0, &plaintext, &newstyle_checksum))) {
+        if ((kret = (*(khp.hash))(key, 0, &plaintext, &newstyle_checksum))) {
             printf("krb5_calculate_checksum choked with %d\n", kret);
             break;
         }
         print_checksum("correct", MD, argv[msgindex], &newstyle_checksum);
 
-        if ((kret = (*(khp.verify))(key, 0, 0, &plaintext, &newstyle_checksum,
+        if ((kret = (*(khp.verify))(key, 0, &plaintext, &newstyle_checksum,
                                     &valid))) {
             printf("verify on new checksum choked with %d\n", kret);
             break;
@@ -146,7 +146,7 @@ main(argc, argv)
         printf("Verify succeeded for \"%s\"\n", argv[msgindex]);
 
         newstyle_checksum.data[0]++;
-        if ((kret = (*(khp.verify))(key, 0, 0, &plaintext, &newstyle_checksum,
+        if ((kret = (*(khp.verify))(key, 0, &plaintext, &newstyle_checksum,
                                     &valid))) {
             printf("verify on new checksum choked with %d\n", kret);
             break;
@@ -163,7 +163,7 @@ main(argc, argv)
             kret = 1;
             break;
         }
-        if ((kret = (*(khp.verify))(key, 0, 0, &plaintext, &knowncksum_dat,
+        if ((kret = (*(khp.verify))(key, 0, &plaintext, &knowncksum_dat,
                                     &valid))) {
             printf("verify on known checksum choked with %d\n", kret);
             break;
index 7b95d588e64fc9260b61d0ba63199d1dffe6d930..67835f4e5876fbf78525ee2a2da59a66f2f4967e 100644 (file)
@@ -79,7 +79,7 @@ krb5int_c_make_checksum_iov(const struct krb5_cksumtypes *cksum_type,
         if (cksum_type->keyhash->hash_iov == NULL)
             return KRB5_BAD_ENCTYPE;
 
-        ret = cksum_type->keyhash->hash_iov(key, usage, 0, data, num_data,
+        ret = cksum_type->keyhash->hash_iov(key, usage, data, num_data,
                                             cksum_data);
     } else if (cksum_type->flags & KRB5_CKSUMFLAG_DERIVE) {
         ret = krb5int_dk_make_checksum(cksum_type->hash, key, usage, data,
index 1ed226020880f182e86210059050bb5838131b3a..95816676d271b551e3c349f96349f5ba4c8a0b33 100644 (file)
@@ -30,8 +30,8 @@
 #include "keyhash_provider.h"
 
 static krb5_error_code
-k5_descbc_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec,
-               const krb5_data *input, krb5_data *output)
+k5_descbc_hash(krb5_key key, krb5_keyusage usage, const krb5_data *input,
+               krb5_data *output)
 {
     mit_des_key_schedule schedule;
 
@@ -39,8 +39,6 @@ k5_descbc_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec,
         return(KRB5_BAD_KEYSIZE);
     if ((input->length%8) != 0)
         return(KRB5_BAD_MSIZE);
-    if (ivec && (ivec->length != 8))
-        return(KRB5_CRYPTO_INTERNAL);
     if (output->length != 8)
         return(KRB5_CRYPTO_INTERNAL);
 
@@ -56,7 +54,6 @@ k5_descbc_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec,
     mit_des_cbc_cksum((unsigned char *) input->data,
                       (unsigned char *) output->data, input->length,
                       schedule,
-                      ivec? (const unsigned char *)ivec->data:
                       (const unsigned char *)mit_des_zeroblock);
 
     memset(schedule, 0, sizeof(schedule));
index f522d0cc7f21d4f8d69653731c1bdb4022d235e5..4da77effbb930fcd1dc714453eaf05afe12a3072 100644 (file)
@@ -37,8 +37,8 @@
 #include "../aead.h"
 
 static  krb5_error_code
-k5_hmac_md5_hash(krb5_key key, krb5_keyusage usage, const krb5_data *iv,
-                 const krb5_data *input, krb5_data *output)
+k5_hmac_md5_hash(krb5_key key, krb5_keyusage usage, const krb5_data *input,
+                 krb5_data *output)
 {
     krb5_keyusage ms_usage;
     krb5_error_code ret;
@@ -80,7 +80,7 @@ cleanup:
 }
 
 static  krb5_error_code
-k5_hmac_md5_hash_iov(krb5_key key, krb5_keyusage usage, const krb5_data *iv,
+k5_hmac_md5_hash_iov(krb5_key key, krb5_keyusage usage,
                      const krb5_crypto_iov *data, size_t num_data,
                      krb5_data *output)
 {
index 89e04bb3453cb5d976b36546c41fd6b68738f2fd..c33f07f35cabedbc83834df41109cc3572b7ee37 100644 (file)
@@ -64,8 +64,8 @@ mk_xorkey(krb5_key origkey, krb5_key *xorkey)
 }
 
 static krb5_error_code
-k5_md4des_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec,
-               const krb5_data *input, krb5_data *output)
+k5_md4des_hash(krb5_key key, krb5_keyusage usage, const krb5_data *input,
+               krb5_data *output)
 {
     krb5_error_code ret;
     krb5_data data;
@@ -113,7 +113,6 @@ k5_md4des_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec,
 
 static krb5_error_code
 k5_md4des_verify(krb5_key key, krb5_keyusage usage,
-                 const krb5_data *ivec,
                  const krb5_data *input, const krb5_data *hash,
                  krb5_boolean *valid)
 {
index 2540e0b54af2f599adb9ae4faf4121e8464750ad..25dc61ce0b8691086f721e87d1375dfbe21f8541 100644 (file)
@@ -64,8 +64,8 @@ mk_xorkey(krb5_key origkey, krb5_key *xorkey)
 }
 
 static krb5_error_code
-k5_md5des_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec,
-               const krb5_data *input, krb5_data *output)
+k5_md5des_hash(krb5_key key, krb5_keyusage usage, const krb5_data *input,
+               krb5_data *output)
 {
     krb5_error_code ret;
     krb5_data data;
@@ -113,9 +113,8 @@ k5_md5des_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec,
 }
 
 static krb5_error_code
-k5_md5des_verify(krb5_key key, krb5_keyusage usage, const krb5_data *ivec,
-                 const krb5_data *input, const krb5_data *hash,
-                 krb5_boolean *valid)
+k5_md5des_verify(krb5_key key, krb5_keyusage usage, const krb5_data *input,
+                 const krb5_data *hash, krb5_boolean *valid)
 {
     krb5_error_code ret;
     krb5_MD5_CTX ctx;
index 39b2c18abd3832b196858ed8a23021404f0c2796..45a4e5d704ea3f26200b43d59e5d433ecb256658 100644 (file)
@@ -34,8 +34,8 @@
 #include "hash_provider.h"
 
 static  krb5_error_code
-k5_md5_hmac_hash(krb5_key key, krb5_keyusage usage, const krb5_data *iv,
-                 const krb5_data *input, krb5_data *output)
+k5_md5_hmac_hash(krb5_key key, krb5_keyusage usage, const krb5_data *input,
+                 krb5_data *output)
 {
     krb5_keyusage ms_usage;
     krb5_MD5_CTX ctx;
index bc69dfb5c43406b4f2ede3b22d508708e52cae3d..2a0ede1c2d7372868b391a7675cd713c30878f2c 100644 (file)
@@ -82,9 +82,9 @@ krb5_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype,
         keyhash = ctp->keyhash;
         if (keyhash->hash == NULL) {
             assert(keyhash->hash_iov != NULL);
-            ret = (*keyhash->hash_iov)(key, usage, 0, &iov, 1, &data);
+            ret = (*keyhash->hash_iov)(key, usage, &iov, 1, &data);
         } else {
-            ret = (*keyhash->hash)(key, usage, 0, input, &data);
+            ret = (*keyhash->hash)(key, usage, input, &data);
         }
     } else if (ctp->flags & KRB5_CKSUMFLAG_DERIVE) {
         ret = krb5int_dk_make_checksum(ctp->hash, key, usage, &iov, 1, &data);
index 3664abd02edfbeb7acb6843e988ca9bada72971e..177c5eb16dde90e86aba4ccfc93a93eaa80f08c8 100644 (file)
@@ -63,10 +63,9 @@ krb5_k_verify_checksum(krb5_context context, krb5_key key,
             iov[0].data.data = data->data;
             iov[0].data.length = data->length;
 
-            return (*keyhash->verify_iov)(key, usage, 0, iov, 1, &indata,
-                                          valid);
+            return (*keyhash->verify_iov)(key, usage, iov, 1, &indata, valid);
         } else if (keyhash->verify != NULL) {
-            return (*keyhash->verify)(key, usage, 0, data, &indata, valid);
+            return (*keyhash->verify)(key, usage, data, &indata, valid);
         }
     }
 
index 19f1f5ed33219523baa819eabcb79937bf1a8e02..e0af46c0ae52d0aab2b2beae4841d6ada94fbe6b 100644 (file)
@@ -60,7 +60,7 @@ krb5_k_verify_checksum_iov(krb5_context context,
 
     /* If there's actually a verify function, call it. */
     if (ctp->keyhash && ctp->keyhash->verify_iov) {
-        return (*ctp->keyhash->verify_iov)(key, usage, 0, data, num_data,
+        return (*ctp->keyhash->verify_iov)(key, usage, data, num_data,
                                            &checksum->data, valid);
     }