From 81997ac2c8771b0dbf808738cd41a4de2105d3ea Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Fri, 16 Feb 2001 15:26:37 +0000 Subject: [PATCH] correct weak keys and update comment git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9694 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/set_key.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/des/set_key.c b/lib/des/set_key.c index ad41ff35a..a6f307efe 100644 --- a/lib/des/set_key.c +++ b/lib/des/set_key.c @@ -97,7 +97,7 @@ des_cblock (*key); return(1); } -/* Weak and semi week keys as take from +/* Weak and semi week keys were originally as take from * %A D.W. Davies * %A W.L. Price * %T Security for Computer Networks @@ -106,13 +106,18 @@ des_cblock (*key); * Many thanks to smb@ulysses.att.com (Steven Bellovin) for the reference * (and actual cblock values). */ + +/* The corrected values are from FIPS 74: + * http://www.itl.nist.gov/fipspubs/fip74.htm + */ + #define NUM_WEAK_KEY 16 static des_cblock weak_keys[NUM_WEAK_KEY]={ /* weak keys */ {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}, {0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE}, - {0x1F,0x1F,0x1F,0x1F,0xE0,0xE0,0xE0,0xE0}, - {0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0}, + {0x1F,0x1F,0x1F,0x1F,0x0E,0x0E,0x0E,0x0E}, + {0xE0,0xE0,0xE0,0xE0,0xF1,0xF1,0xF1,0xF1}, /* semi-weak keys */ {0x01,0xFE,0x01,0xFE,0x01,0xFE,0x01,0xFE}, {0xFE,0x01,0xFE,0x01,0xFE,0x01,0xFE,0x01},