diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-10-12 20:48:59 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-10-12 20:48:59 +0000 |
commit | 6fbb20eb585c947850e2e7f85a8000bbb734755c (patch) | |
tree | a8c2cb5c76ed8033e78ab4ef2e9b3b1f76b23114 /lib | |
parent | 2cd5db3c658c54ee7d220794a4598e8f5a5b0f56 (diff) |
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?
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/des/set_key.c | 24 |
1 files changed, 10 insertions, 14 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. |