From: Robbie Harwood Date: Tue, 13 Jul 2021 20:39:49 +0000 (-0400) Subject: Remove unused internal DES functions X-Git-Tag: krb5-1.20-beta1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1204%2Fhead;p=thirdparty%2Fkrb5.git Remove unused internal DES functions k5_des_is_weak_key() and k5_rand2key_des() have no callers since fb2dada5eb89c4cd4e39dedd6dbb7dbd5e94f8b8 removed single-DES support. --- diff --git a/src/lib/crypto/builtin/des/des_keys.c b/src/lib/crypto/builtin/des/des_keys.c index 32b119aade..06121d6241 100644 --- a/src/lib/crypto/builtin/des/des_keys.c +++ b/src/lib/crypto/builtin/des/des_keys.c @@ -32,9 +32,3 @@ k5_des_fixup_key_parity(unsigned char *keybits) { mit_des_fixup_key_parity(keybits); } - -krb5_boolean -k5_des_is_weak_key(unsigned char *keybits) -{ - return mit_des_is_weak_key(keybits); -} diff --git a/src/lib/crypto/krb/crypto_int.h b/src/lib/crypto/krb/crypto_int.h index 19f808749f..6e1096e50f 100644 --- a/src/lib/crypto/krb/crypto_int.h +++ b/src/lib/crypto/krb/crypto_int.h @@ -276,8 +276,6 @@ krb5_error_code krb5int_aes2_string_to_key(const struct krb5_keytypes *enc, /* Random to key */ krb5_error_code k5_rand2key_direct(const krb5_data *randombits, krb5_keyblock *keyblock); -krb5_error_code k5_rand2key_des(const krb5_data *randombits, - krb5_keyblock *keyblock); krb5_error_code k5_rand2key_des3(const krb5_data *randombits, krb5_keyblock *keyblock); @@ -445,9 +443,6 @@ extern const struct krb5_hash_provider krb5int_hash_sha384; /* Set the parity bits to the correct values in keybits. */ void k5_des_fixup_key_parity(unsigned char *keybits); -/* Return true if keybits is a weak or semi-weak DES key. */ -krb5_boolean k5_des_is_weak_key(unsigned char *keybits); - /* Compute an HMAC using the provided hash function, key, and data, storing the * result into output (caller-allocated). */ krb5_error_code krb5int_hmac(const struct krb5_hash_provider *hash, diff --git a/src/lib/crypto/krb/random_to_key.c b/src/lib/crypto/krb/random_to_key.c index 1574625268..9394385aa0 100644 --- a/src/lib/crypto/krb/random_to_key.c +++ b/src/lib/crypto/krb/random_to_key.c @@ -80,23 +80,6 @@ eighth_byte(unsigned char *b) ((b[6] & 1) << 7)); } -krb5_error_code -k5_rand2key_des(const krb5_data *randombits, krb5_keyblock *keyblock) -{ - if (randombits->length != 7) - return(KRB5_CRYPTO_INTERNAL); - - keyblock->magic = KV5M_KEYBLOCK; - - /* Take the seven bytes, move them around into the top 7 bits of the - * 8 key bytes, then compute the parity bits. */ - memcpy(keyblock->contents, randombits->data, randombits->length); - eighth_byte(keyblock->contents); - k5_des_fixup_key_parity(keyblock->contents); - - return 0; -} - krb5_error_code k5_rand2key_des3(const krb5_data *randombits, krb5_keyblock *keyblock) { diff --git a/src/lib/crypto/openssl/des/des_keys.c b/src/lib/crypto/openssl/des/des_keys.c index 51d9db216c..eb6936ccba 100644 --- a/src/lib/crypto/openssl/des/des_keys.c +++ b/src/lib/crypto/openssl/des/des_keys.c @@ -32,9 +32,3 @@ k5_des_fixup_key_parity(unsigned char *keybits) { DES_set_odd_parity((DES_cblock *)keybits); } - -krb5_boolean -k5_des_is_weak_key(unsigned char *keybits) -{ - return DES_is_weak_key((DES_cblock *)keybits); -}