diff options
author | 2014-10-12 20:48:58 +0000 | |
---|---|---|
committer | 2014-10-12 20:48:58 +0000 | |
commit | a1a8ce889cc578ceb08e6b398f7b9426688ba513 (patch) | |
tree | dc6fe259ad1bead2a0bc23c65066e399ec1ee9eb | |
parent | Paranoia: in ASN1_mbstring_ncopy(), check for len < 0 instead of len == -1, (diff) | |
download | wireguard-openbsd-a1a8ce889cc578ceb08e6b398f7b9426688ba513.tar.xz wireguard-openbsd-a1a8ce889cc578ceb08e6b398f7b9426688ba513.zip |
Remove useless comments in DES_is_weak_key(). Do we really care that this
function was found broken in 1993, and later on in 1997?
-rw-r--r-- | lib/libcrypto/des/set_key.c | 24 | ||||
-rw-r--r-- | lib/libssl/src/crypto/des/set_key.c | 24 |
2 files changed, 20 insertions, 28 deletions
diff --git a/lib/libcrypto/des/set_key.c b/lib/libcrypto/des/set_key.c index bb8270bebab..1901ecd647f 100644 --- a/lib/libcrypto/des/set_key.c +++ b/lib/libcrypto/des/set_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: set_key.c,v 1.17 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: set_key.c,v 1.18 2014/10/12 20:48:58 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -136,20 +136,16 @@ static const DES_cblock weak_keys[NUM_WEAK_KEY]={ {0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1,0xFE}, {0xFE,0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1}}; -int DES_is_weak_key(const_DES_cblock *key) - { - int i; +int +DES_is_weak_key(const_DES_cblock *key) +{ + unsigned int i; - for (i=0; i<NUM_WEAK_KEY; i++) - /* Added == 0 to comparison, I obviously don't run - * this section very often :-(, thanks to - * engineering@MorningStar.Com for the fix - * eay 93/06/29 - * Another problem, I was comparing only the first 4 - * bytes, 97/03/18 */ - if (memcmp(weak_keys[i],key,sizeof(DES_cblock)) == 0) return(1); - return(0); - } + for (i = 0; i < NUM_WEAK_KEY; i++) + if (memcmp(weak_keys[i], key, sizeof(DES_cblock)) == 0) + return 1; + return 0; +} /* NOW DEFINED IN des_local.h * See ecb_encrypt.c for a pseudo description of these macros. diff --git a/lib/libssl/src/crypto/des/set_key.c b/lib/libssl/src/crypto/des/set_key.c index bb8270bebab..1901ecd647f 100644 --- a/lib/libssl/src/crypto/des/set_key.c +++ b/lib/libssl/src/crypto/des/set_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: set_key.c,v 1.17 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: set_key.c,v 1.18 2014/10/12 20:48:58 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -136,20 +136,16 @@ static const DES_cblock weak_keys[NUM_WEAK_KEY]={ {0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1,0xFE}, {0xFE,0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1}}; -int DES_is_weak_key(const_DES_cblock *key) - { - int i; +int +DES_is_weak_key(const_DES_cblock *key) +{ + unsigned int i; - for (i=0; i<NUM_WEAK_KEY; i++) - /* Added == 0 to comparison, I obviously don't run - * this section very often :-(, thanks to - * engineering@MorningStar.Com for the fix - * eay 93/06/29 - * Another problem, I was comparing only the first 4 - * bytes, 97/03/18 */ - if (memcmp(weak_keys[i],key,sizeof(DES_cblock)) == 0) return(1); - return(0); - } + for (i = 0; i < NUM_WEAK_KEY; i++) + if (memcmp(weak_keys[i], key, sizeof(DES_cblock)) == 0) + return 1; + return 0; +} /* NOW DEFINED IN des_local.h * See ecb_encrypt.c for a pseudo description of these macros. |