[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Wed Jun 14 19:29:21 UTC 2017


The branch master has been updated
       via  594da712ffe416e61eeedc736d0332fa4664b24f (commit)
      from  5419dadd4bd1f7abbfa23326ca766d2c143f257c (commit)


- Log -----------------------------------------------------------------
commit 594da712ffe416e61eeedc736d0332fa4664b24f
Author: Rich Salz <rsalz at openssl.org>
Date:   Wed Jun 14 12:05:25 2017 -0400

    Remove OLD_STR_TO_KEY compile option
    
    This flag was added in 1992 and only documented in the CHANGES file.
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3681)

-----------------------------------------------------------------------

Summary of changes:
 crypto/des/str2key.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/crypto/des/str2key.c b/crypto/des/str2key.c
index 78998a1..e18d726 100644
--- a/crypto/des/str2key.c
+++ b/crypto/des/str2key.c
@@ -17,10 +17,6 @@ void DES_string_to_key(const char *str, DES_cblock *key)
 
     memset(key, 0, 8);
     length = strlen(str);
-#ifdef OLD_STR_TO_KEY
-    for (i = 0; i < length; i++)
-        (*key)[i % 8] ^= (str[i] << 1);
-#else                           /* MIT COMPATIBLE */
     for (i = 0; i < length; i++) {
         register unsigned char j = str[i];
 
@@ -34,7 +30,6 @@ void DES_string_to_key(const char *str, DES_cblock *key)
             (*key)[7 - (i % 8)] ^= j;
         }
     }
-#endif
     DES_set_odd_parity(key);
     DES_set_key_unchecked(key, &ks);
     DES_cbc_cksum((const unsigned char *)str, key, length, &ks, key);
@@ -50,20 +45,6 @@ void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2)
     memset(key1, 0, 8);
     memset(key2, 0, 8);
     length = strlen(str);
-#ifdef OLD_STR_TO_KEY
-    if (length <= 8) {
-        for (i = 0; i < length; i++) {
-            (*key2)[i] = (*key1)[i] = (str[i] << 1);
-        }
-    } else {
-        for (i = 0; i < length; i++) {
-            if ((i / 8) & 1)
-                (*key2)[i % 8] ^= (str[i] << 1);
-            else
-                (*key1)[i % 8] ^= (str[i] << 1);
-        }
-    }
-#else                           /* MIT COMPATIBLE */
     for (i = 0; i < length; i++) {
         register unsigned char j = str[i];
 
@@ -84,7 +65,6 @@ void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2)
     }
     if (length <= 8)
         memcpy(key2, key1, 8);
-#endif
     DES_set_odd_parity(key1);
     DES_set_odd_parity(key2);
     DES_set_key_unchecked(key1, &ks);


More information about the openssl-commits mailing list