summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-10-12 20:48:59 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-10-12 20:48:59 +0000
commit4e733227bf0d961124141a2575b5116939cf749b (patch)
tree49ccdd5f4fdfa30819c5ed870c4125874156f9e0
parent60af9e73dcb1ba1090f5c09cc77dcd6d2da67e1c (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?
-rw-r--r--lib/libssl/src/crypto/des/set_key.c24
1 files changed, 10 insertions, 14 deletions
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.