diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2022-02-05 18:00:51 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-02-08 15:22:35 +0100 |
commit | aefbcde29166caf851cf388361d70fd0dcf17d87 (patch) | |
tree | db1a33cfe63ad062316a1bcb9f9b3445897c2c88 /crypto/rsa | |
parent | 14db620282bea38dc44479e562cf9bb61a716444 (diff) | |
download | openssl-aefbcde29166caf851cf388361d70fd0dcf17d87.tar.gz |
rsa: add check after calling BN_BLINDING_lock
As the potential failure of getting lock, we need to check the return
value of the BN_BLINDING_lock() in order to avoid the dirty data.
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17642)
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa_ossl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c index c417a4b8f6..de4a580032 100644 --- a/crypto/rsa/rsa_ossl.c +++ b/crypto/rsa/rsa_ossl.c @@ -213,7 +213,9 @@ static int rsa_blinding_convert(BN_BLINDING *b, BIGNUM *f, BIGNUM *unblind, */ int ret; - BN_BLINDING_lock(b); + if (!BN_BLINDING_lock(b)) + return 0; + ret = BN_BLINDING_convert_ex(f, unblind, b, ctx); BN_BLINDING_unlock(b); |