diff options
author | Bodo Möller <bodo@openssl.org> | 2000-02-24 21:24:45 +0100 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-02-24 21:24:45 +0100 |
commit | 1a33f6da8b86c249ba5438bc7e7f840257fac275 (patch) | |
tree | ca4127fc3692e8957558d98ef50a19708ff8bb97 /crypto/rand/md_rand.c | |
parent | Do fflush(stdout) when there was an error. (diff) | |
download | openssl-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.c | 1 |
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); |