Don't use buffered fread() to read from DEVRANDOM,
because this will drain the entropy pool.
This commit is contained in:
parent
0dd0cbf554
commit
1a33f6da8b
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user