aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-03-29 17:25:52 +0000
committerRichard Levitte <levitte@openssl.org>2000-03-29 17:25:52 +0000
commit7ae634de49b58283dd239a13d26296f10f07a325 (patch)
treec2e2c23fef32e58991d80e5bb657624d61a1f599
parent8311d323783dfdd52ec87cf0429ec67bc21965a1 (diff)
downloadopenssl-7ae634de49b58283dd239a13d26296f10f07a325.tar.gz
Since ssleay_rand_initialize() unlocks then locks CRYPTO_LOCK_RAND,
it's a good thing if ssleay_rand_status() would do the corresponding lock and unlock as everyone else...
-rw-r--r--crypto/rand/md_rand.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index b1d51e890b..79e3484b4d 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -559,8 +559,13 @@ static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num)
static int ssleay_rand_status(void)
{
+ CRYPTO_w_lock(CRYPTO_LOCK_RAND);
+
if (!initialized)
ssleay_rand_initialize();
+
+ CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
+
return (entropy >= ENTROPY_NEEDED);
}