From: Richard Levitte Date: Wed, 29 Mar 2000 17:25:52 +0000 (+0000) Subject: Since ssleay_rand_initialize() unlocks then locks CRYPTO_LOCK_RAND, X-Git-Tag: OpenSSL_0_9_5a~6 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=7ae634de49b58283dd239a13d26296f10f07a325 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... --- 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); }