From 1a33f6da8b86c249ba5438bc7e7f840257fac275 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Thu, 24 Feb 2000 20:24:45 +0000 Subject: [PATCH 1/1] Don't use buffered fread() to read from DEVRANDOM, because this will drain the entropy pool. --- crypto/rand/md_rand.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.34.1