'entropy >= ENTROPY_NEEDED' should be evaluated while the
variables are locked.
This commit is contained in:
parent
35af460fef
commit
b841e0acd8
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue