提交 1a33f6da 编写于 作者: B Bodo Möller

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

because this will drain the entropy pool.
上级 0dd0cbf5
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册