summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_ossl.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-09-09 10:14:32 +1000
committerPauli <paul.dale@oracle.com>2019-09-11 08:27:27 +1000
commit4a3dd6292385a23134e113a01463f9516004ae85 (patch)
treee0d57b087fd00c76ac3e44c7b03e41cbd50290da /crypto/rsa/rsa_ossl.c
parentf20a59cb1c21e360f000e541e2e41aceca515929 (diff)
Coverity 1453629 and 1453638: Error handling issues (NEGATIVE_RETURNS)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/9805)
Diffstat (limited to 'crypto/rsa/rsa_ossl.c')
-rw-r--r--crypto/rsa/rsa_ossl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c
index 29bd97bd1b..5d5efdbd69 100644
--- a/crypto/rsa/rsa_ossl.c
+++ b/crypto/rsa/rsa_ossl.c
@@ -470,6 +470,8 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
goto err;
j = BN_bn2binpad(ret, buf, num);
+ if (j < 0)
+ goto err;
switch (padding) {
case RSA_PKCS1_PADDING:
@@ -569,6 +571,8 @@ static int rsa_ossl_public_decrypt(int flen, const unsigned char *from,
goto err;
i = BN_bn2binpad(ret, buf, num);
+ if (i < 0)
+ goto err;
switch (padding) {
case RSA_PKCS1_PADDING: