Download raw body.
Fix typos in DES weak keys comment
On Sat, Oct 25, 2025 at 06:58:00PM +0200, Thorsten Blum wrote: > On 22. Oct 2025, Thorsten Blum wrote: > > Index: sys/crypto/set_key.c > > =================================================================== > > RCS file: /cvs/src/sys/crypto/set_key.c,v > > retrieving revision 1.5 > > diff -u -p -r1.5 set_key.c > > --- sys/crypto/set_key.c 12 Mar 2021 10:22:46 -0000 1.5 > > +++ sys/crypto/set_key.c 21 Oct 2025 11:38:57 -0000 > > @@ -74,7 +74,7 @@ check_parity(des_cblock (*key)) > > return (1); > > } > > > > -/* Weak and semi week keys as take from > > +/* Weak and semi-weak keys as taken from > > * %A D.W. Davies > > * %A W.L. Price > > * %T Security for Computer Networks > > While browsing the book referenced above (available at [1]), I noticed > that some of the weak key values differ from those in the book (page 65, > figure 3.17). The patch below shows the different values. Not sure if > this is intentional or a bug. > > Additionally, it appears that 'weak_keys' and des_is_weak_key() may no > longer be used. des_is_weak_key() is only called from des_set_key() when > 'int des_check_key' is true, but I couldn't find any code in /usr/src > setting this variable. > > Should the values be fixed, or is the code obsolete/unused and about to > be removed anyway? I have committed your two diffs. I agree that this is currently unreachable. I'm not sure if we still need DES in the kernel at all... You rediscovered a very old bug. These keys were fixed in SSLeay 0.9.1b end of December 1998 and in libcrypto when OpenSSL 0.9.4 was imported.
Fix typos in DES weak keys comment