Don't use buffered fread() to read from DEVRANDOM,
because this will drain the entropy pool.
This commit is contained in:
@@ -327,6 +327,7 @@ static void ssleay_rand_initialize(void)
|
|||||||
unsigned char tmpbuf[ENTROPY_NEEDED];
|
unsigned char tmpbuf[ENTROPY_NEEDED];
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
setvbuf(fh, NULL, _IONBF, 0);
|
||||||
n=fread((unsigned char *)tmpbuf,1,ENTROPY_NEEDED,fh);
|
n=fread((unsigned char *)tmpbuf,1,ENTROPY_NEEDED,fh);
|
||||||
fclose(fh);
|
fclose(fh);
|
||||||
RAND_add(tmpbuf,sizeof tmpbuf,n);
|
RAND_add(tmpbuf,sizeof tmpbuf,n);
|
||||||
|
|||||||
Reference in New Issue
Block a user