Don't use buffered fread() to read from DEVRANDOM,

because this will drain the entropy pool.
This commit is contained in:
Bodo Möller 2000-02-24 20:24:45 +00:00
parent 0dd0cbf554
commit 1a33f6da8b

View File

@ -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);