diff options
author | djm <djm> | 2000-06-26 03:55:31 +0000 |
---|---|---|
committer | djm <djm> | 2000-06-26 03:55:31 +0000 |
commit | 37b6faacf2b5bc174cb4b2fb1a60cf4964b795bf (patch) | |
tree | f522e2d7accb208eb24117b8729ebe42607c1ce0 /entropy.c | |
parent | a2c223c484477e2b82722f5e635dc7133a07cae7 (diff) | |
download | openssh-37b6faacf2b5bc174cb4b2fb1a60cf4964b795bf.tar.gz |
Fix fixed egd code
Diffstat (limited to 'entropy.c')
-rw-r--r-- | entropy.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -35,7 +35,7 @@ #include <openssl/rand.h> #include <openssl/sha.h> -RCSID("$Id: entropy.c,v 1.15 2000/06/26 03:01:33 djm Exp $"); +RCSID("$Id: entropy.c,v 1.16 2000/06/26 03:55:31 djm Exp $"); #ifndef offsetof # define offsetof(type, member) ((size_t) &((type *)0)->member) @@ -158,11 +158,13 @@ seed_rng(void) debug("Seeding random number generator"); - if (!get_random_bytes(buf, sizeof(buf)) && !RAND_status()) - fatal("Entropy collection failed and entropy exhausted"); - - RAND_add(buf, sizeof(buf), sizeof(buf)); - + if (!get_random_bytes(buf, sizeof(buf))) { + if (!RAND_status()) + fatal("Entropy collection failed and entropy exhausted"); + } else { + RAND_add(buf, sizeof(buf), sizeof(buf)); + } + memset(buf, '\0', sizeof(buf)); } |