From 7ae634de49b58283dd239a13d26296f10f07a325 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 29 Mar 2000 17:25:52 +0000 Subject: [PATCH] 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... --- crypto/rand/md_rand.c | 5 +++++ 1 file changed, 5 insertions(+) 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); } -- 2.34.1