From: Bodo Möller Date: Thu, 24 Feb 2000 20:24:45 +0000 (+0000) Subject: Don't use buffered fread() to read from DEVRANDOM, X-Git-Tag: OpenSSL_0_9_5beta2~83 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1a33f6da8b86c249ba5438bc7e7f840257fac275;p=oweals%2Fopenssl.git Don't use buffered fread() to read from DEVRANDOM, because this will drain the entropy pool. --- 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);