From 0c3ba5525f2e3fff51da72bdfaa35ce7dae9f800 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sun, 6 Dec 2009 15:57:36 +0000 Subject: [PATCH] In the built-in des3 provider, remove the unused version of 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 | 32 ++-------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/src/lib/crypto/builtin/enc_provider/des3.c b/src/lib/crypto/builtin/enc_provider/des3.c index e41773b82..17c343399 100644 --- a/src/lib/crypto/builtin/enc_provider/des3.c +++ b/src/lib/crypto/builtin/enc_provider/des3.c @@ -32,34 +32,8 @@ 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; -- 2.26.2