Fix async engine pause dead lock in error case.
authorEmeric Brun <ebrun@haproxy.com>
Wed, 26 Jul 2017 13:59:21 +0000 (15:59 +0200)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 26 Jul 2017 17:03:17 +0000 (12:03 -0500)
In 'crypto/rand/ossl_rand.c', a call to
'ASYNC_unblock_pause()' is missing in an error case.

CLA: trivial

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(cherry picked from commit e4b16013e9b3d19241d3ba0bb0875f0d70d93509)

(Merged from https://github.com/openssl/openssl/pull/4024)

crypto/rand/md_rand.c

index 85ce4e6f982ed299cf1695a9f2b6a8cd4cce4eb2..fee722abf7bd7ac30025a0cbee79b892fd339148 100644 (file)
@@ -492,6 +492,7 @@ static int rand_bytes(unsigned char *buf, int num, int pseudo)
      */
     ASYNC_block_pause();
     if (!MD_Update(m, md, MD_DIGEST_LENGTH) || !MD_Final(m, md)) {
+        ASYNC_unblock_pause();
         CRYPTO_THREAD_unlock(rand_lock);
         goto err;
     }