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

'entropy >= ENTROPY_NEEDED' should be evaluated while the

variables are locked.
上级 35af460f
......@@ -559,14 +559,17 @@ static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num)
static int ssleay_rand_status(void)
{
int ret;
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
if (!initialized)
ssleay_rand_initialize();
ret = entropy >= ENTROPY_NEEDED;
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
return (entropy >= ENTROPY_NEEDED);
return ret;
}
#ifdef WINDOWS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册