krb5 commit: Remove unused internal DES functions

Greg Hudson ghudson at mit.edu
Wed Aug 25 18:36:27 EDT 2021


https://github.com/krb5/krb5/commit/40b1e237a04b584d8d6d482318392fafc89f6b36
commit 40b1e237a04b584d8d6d482318392fafc89f6b36
Author: Robbie Harwood <rharwood at redhat.com>
Date:   Tue Jul 13 16:39:49 2021 -0400

    Remove unused internal DES functions
    
    k5_des_is_weak_key() and k5_rand2key_des() have no callers since
    fb2dada5eb89c4cd4e39dedd6dbb7dbd5e94f8b8 removed single-DES support.

 src/lib/crypto/builtin/des/des_keys.c |    6 ------
 src/lib/crypto/krb/crypto_int.h       |    5 -----
 src/lib/crypto/krb/random_to_key.c    |   17 -----------------
 src/lib/crypto/openssl/des/des_keys.c |    6 ------
 4 files changed, 0 insertions(+), 34 deletions(-)

diff --git a/src/lib/crypto/builtin/des/des_keys.c b/src/lib/crypto/builtin/des/des_keys.c
index 32b119a..06121d6 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 19f8087..6e1096e 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 1574625..9394385 100644
--- a/src/lib/crypto/krb/random_to_key.c
+++ b/src/lib/crypto/krb/random_to_key.c
@@ -81,23 +81,6 @@ eighth_byte(unsigned char *b)
 }
 
 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)
 {
     int i;
diff --git a/src/lib/crypto/openssl/des/des_keys.c b/src/lib/crypto/openssl/des/des_keys.c
index 51d9db2..eb6936c 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);
-}


More information about the cvs-krb5 mailing list