]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Only unlock in rsa_get_blinding when locking was successful
authortwo-heart <12869538+two-heart@users.noreply.github.com>
Thu, 4 Sep 2025 10:20:53 +0000 (12:20 +0200)
committerPauli <ppzgs1@gmail.com>
Fri, 5 Sep 2025 12:19:43 +0000 (22:19 +1000)
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28438)

crypto/rsa/rsa_ossl.c

index 4165562757cb9514de662119b59c44b8236e4487..1e56c6d38c61feec34a8d40bff8457cabe728043 100644 (file)
@@ -264,8 +264,8 @@ static BN_BLINDING *rsa_get_blinding(RSA *rsa, BN_CTX *ctx)
                 BN_BLINDING_free(ret);
                 ret = NULL;
             }
+            CRYPTO_THREAD_unlock(rsa->lock);
         }
-        CRYPTO_THREAD_unlock(rsa->lock);
     }
 
     return ret;