summaryrefslogtreecommitdiffstats
path: root/crypto/des/rand_key.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>1999-12-03 20:24:21 +0000
committerBodo Möller <bodo@openssl.org>1999-12-03 20:24:21 +0000
commitcddfe788fbbc4726fcf9892963df3f3e823eb233 (patch)
treefe129b6f8b162a2053634fdfb62d17d9dad17a10 /crypto/des/rand_key.c
parent21131f00d7ffcdac99334ce5704366c1cdd06fc4 (diff)
Add functions des_set_key_checked, des_set_key_unchecked.
Never use des_set_key (it depends on the global variable des_check_key), but usually des_set_key_unchecked. Only destest.c bothered to look at the return values of des_set_key, but it did not set des_check_key -- if it had done so, most checks would have failed because of wrong parity and because of weak keys.
Diffstat (limited to 'crypto/des/rand_key.c')
-rw-r--r--crypto/des/rand_key.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/des/rand_key.c b/crypto/des/rand_key.c
index fc11792cda..2032c59df6 100644
--- a/crypto/des/rand_key.c
+++ b/crypto/des/rand_key.c
@@ -100,11 +100,11 @@ void des_random_key(des_cblock *ret)
l2c(t,p);
des_set_odd_parity(&data);
- des_set_key(&data,ks);
+ des_set_key_unchecked(&data,ks);
des_cbc_cksum(key,&key,sizeof(key),ks,&data);
des_set_odd_parity(&key);
- des_set_key(&key,ks);
+ des_set_key_unchecked(&key,ks);
des_cbc_cksum(key,&data,sizeof(key),ks,&key);
memcpy(ret,data,sizeof(key));