'entropy >= ENTROPY_NEEDED' should be evaluated while the
variables are locked.
This commit is contained in:
parent
35af460fef
commit
b841e0acd8
@ -559,14 +559,17 @@ static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num)
|
|||||||
|
|
||||||
static int ssleay_rand_status(void)
|
static int ssleay_rand_status(void)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
|
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
ssleay_rand_initialize();
|
ssleay_rand_initialize();
|
||||||
|
ret = entropy >= ENTROPY_NEEDED;
|
||||||
|
|
||||||
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
|
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
|
||||||
|
|
||||||
return (entropy >= ENTROPY_NEEDED);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user