In DES_random_key(), force the generated key to the odd parity before checking
authormiod <miod@openbsd.org>
Tue, 22 Jul 2014 18:09:20 +0000 (18:09 +0000)
committermiod <miod@openbsd.org>
Tue, 22 Jul 2014 18:09:20 +0000 (18:09 +0000)
commitfe9e927b846fa3204aaa6da1e6e55a8d7d8f859d
treec3b315a7d184bcfc6e31044f824926636cc742fa
parent0650b93a167c014832fc614d0dac7f17f0a0277a
In DES_random_key(), force the generated key to the odd parity before checking
it is not one of the weak and semi-weak keys.

Even though the probability of generating a weak key with incorrect parity is
abysmally small, there is no reason to be correct (although, if you're in a
need for fresh DES keys nowadays, you should seriously consider switching to
a stronger symmetric cipher algorithm).

ok beck@
lib/libcrypto/des/rand_key.c
lib/libssl/src/crypto/des/rand_key.c