summaryrefslogtreecommitdiffstats
path: root/crypto/rand/md_rand.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-02-24 21:24:45 +0100
committerBodo Möller <bodo@openssl.org>2000-02-24 21:24:45 +0100
commit1a33f6da8b86c249ba5438bc7e7f840257fac275 (patch)
treeca4127fc3692e8957558d98ef50a19708ff8bb97 /crypto/rand/md_rand.c
parentDo fflush(stdout) when there was an error. (diff)
downloadopenssl-1a33f6da8b86c249ba5438bc7e7f840257fac275.tar.xz
openssl-1a33f6da8b86c249ba5438bc7e7f840257fac275.zip
Don't use buffered fread() to read from DEVRANDOM,
because this will drain the entropy pool.
Diffstat (limited to 'crypto/rand/md_rand.c')
-rw-r--r--crypto/rand/md_rand.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index 79438611f2..ce901759db 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -327,6 +327,7 @@ static void ssleay_rand_initialize(void)
unsigned char tmpbuf[ENTROPY_NEEDED];
int n;
+ setvbuf(fh, NULL, _IONBF, 0);
n=fread((unsigned char *)tmpbuf,1,ENTROPY_NEEDED,fh);
fclose(fh);
RAND_add(tmpbuf,sizeof tmpbuf,n);