]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Remove unused internal DES functions 1204/head
authorRobbie Harwood <rharwood@redhat.com>
Tue, 13 Jul 2021 20:39:49 +0000 (16:39 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 25 Aug 2021 22:19:59 +0000 (18:19 -0400)
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
src/lib/crypto/krb/crypto_int.h
src/lib/crypto/krb/random_to_key.c
src/lib/crypto/openssl/des/des_keys.c

index 32b119aade70cd3e4b4baa40f2933a832ff72ff7..06121d62412c67a23a78a0048bd671feb7766f58 100644 (file)
@@ -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);
-}
index 19f808749f5a67807a5215775240d36cd7ec5440..6e1096e50f6acc4ca64bf228aebd273e6662eb45 100644 (file)
@@ -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,
index 1574625268c9f7706e2a95aaf117e705acca04b4..9394385aa08f92ff6f0cdd2956313bf6bccaa0e8 100644 (file)
@@ -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)
 {
index 51d9db216c6b98dec63d0807fd6fe6e2c4e77c96..eb6936ccba2722af3c8636faf28288db13de2a6f 100644 (file)
@@ -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);
-}