summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--entropy.c14
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 9fd1c7864..f6f70c91e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
4 - (djm) Added password expiry checking (no password change support) 4 - (djm) Added password expiry checking (no password change support)
5 - (djm) Make EGD failures non-fatal if OpenSSL's entropy pool is still OK 5 - (djm) Make EGD failures non-fatal if OpenSSL's entropy pool is still OK
6 based on patch from Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> 6 based on patch from Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>
7 - (djm) Fix fixed EGD code.
7 - OpenBSD CVS update 8 - OpenBSD CVS update
8 - provos@cvs.openbsd.org 2000/06/25 14:17:58 9 - provos@cvs.openbsd.org 2000/06/25 14:17:58
9 [channels.c] 10 [channels.c]
diff --git a/entropy.c b/entropy.c
index 83759ca65..d8eba6547 100644
--- a/entropy.c
+++ b/entropy.c
@@ -35,7 +35,7 @@
35#include <openssl/rand.h> 35#include <openssl/rand.h>
36#include <openssl/sha.h> 36#include <openssl/sha.h>
37 37
38RCSID("$Id: entropy.c,v 1.15 2000/06/26 03:01:33 djm Exp $"); 38RCSID("$Id: entropy.c,v 1.16 2000/06/26 03:55:31 djm Exp $");
39 39
40#ifndef offsetof 40#ifndef offsetof
41# define offsetof(type, member) ((size_t) &((type *)0)->member) 41# define offsetof(type, member) ((size_t) &((type *)0)->member)
@@ -158,11 +158,13 @@ seed_rng(void)
158 158
159 debug("Seeding random number generator"); 159 debug("Seeding random number generator");
160 160
161 if (!get_random_bytes(buf, sizeof(buf)) && !RAND_status()) 161 if (!get_random_bytes(buf, sizeof(buf))) {
162 fatal("Entropy collection failed and entropy exhausted"); 162 if (!RAND_status())
163 163 fatal("Entropy collection failed and entropy exhausted");
164 RAND_add(buf, sizeof(buf), sizeof(buf)); 164 } else {
165 165 RAND_add(buf, sizeof(buf), sizeof(buf));
166 }
167
166 memset(buf, '\0', sizeof(buf)); 168 memset(buf, '\0', sizeof(buf));
167} 169}
168 170