'entropy >= ENTROPY_NEEDED' should be evaluated while the

variables are locked.
This commit is contained in:
Bodo Möller 2000-03-30 06:11:54 +00:00
parent 35af460fef
commit b841e0acd8

View file

@ -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