In the built-in des3 provider, remove the unused version of
authorGreg Hudson <ghudson@mit.edu>
Sun, 6 Dec 2009 15:57:36 +0000 (15:57 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sun, 6 Dec 2009 15:57:36 +0000 (15:57 +0000)
validate_and_schedule, and drop the _iov suffix from the one we do
use.  (Cleanup from r23444.)

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

src/lib/crypto/builtin/enc_provider/des3.c

index e41773b82f078d828306a9129fdf844699d66745..17c34339991edffa834e64ea886032dc8337b381 100644 (file)
 
 static krb5_error_code
 validate_and_schedule(krb5_key key, const krb5_data *ivec,
-                      const krb5_data *input, const krb5_data *output,
+                      const krb5_crypto_iov *data, size_t num_data,
                       mit_des3_key_schedule *schedule)
-{
-    /* key->keyblock.enctype was checked by the caller */
-
-    if (key->keyblock.length != 24)
-        return(KRB5_BAD_KEYSIZE);
-    if ((input->length%8) != 0)
-        return(KRB5_BAD_MSIZE);
-    if (ivec && (ivec->length != 8))
-        return(KRB5_BAD_MSIZE);
-    if (input->length != output->length)
-        return(KRB5_BAD_MSIZE);
-
-    switch (mit_des3_key_sched(*(mit_des3_cblock *)key->keyblock.contents,
-                               *schedule)) {
-    case -1:
-        return(KRB5DES_BAD_KEYPAR);
-    case -2:
-        return(KRB5DES_WEAK_KEY);
-    }
-    return 0;
-}
-
-static krb5_error_code
-validate_and_schedule_iov(krb5_key key, const krb5_data *ivec,
-                          const krb5_crypto_iov *data, size_t num_data,
-                          mit_des3_key_schedule *schedule)
 {
     size_t i, input_length;
 
@@ -94,7 +68,7 @@ k5_des3_encrypt(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
     mit_des3_key_schedule schedule;
     krb5_error_code err;
 
-    err = validate_and_schedule_iov(key, ivec, data, num_data, &schedule);
+    err = validate_and_schedule(key, ivec, data, num_data, &schedule);
     if (err)
         return err;
 
@@ -116,7 +90,7 @@ k5_des3_decrypt(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
     mit_des3_key_schedule schedule;
     krb5_error_code err;
 
-    err = validate_and_schedule_iov(key, ivec, data, num_data, &schedule);
+    err = validate_and_schedule(key, ivec, data, num_data, &schedule);
     if (err)
         return err;