提交 28e5428d 编写于 作者: L Lutz Jänicke

Don't cheat: when only getting several bytes from each source, n is incremented

correctly, but RAND_add(..,n) counts the increasing n several times.
Only RAND_add(..,n) once entropy collection is finished.
上级 3c914840
......@@ -183,10 +183,13 @@ int RAND_poll(void)
&& t.tv_usec != 0 && n < ENTROPY_NEEDED);
close(fd);
RAND_add(tmpbuf,sizeof tmpbuf,n);
memset(tmpbuf,0,n);
}
}
if (n > 0)
{
RAND_add(tmpbuf,sizeof tmpbuf,n);
memset(tmpbuf,0,n);
}
#endif
/* put in some default random data, we need more than just this */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册