X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Frsa%2Frsa_ossl.c;h=c441905526c82b0e49c1945e9262498bbb0c6688;hp=feb1ab4f0746dfa10f2f5f8c4389cc279d8dd6fb;hb=3d3cbce550ff5d6172cf28dbbf80bda93f6577a9;hpb=35c9408108f3608eb572acd7f64a93cf4f43f4f6 diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c index feb1ab4f07..c441905526 100644 --- a/crypto/rsa/rsa_ossl.c +++ b/crypto/rsa/rsa_ossl.c @@ -339,7 +339,8 @@ static int rsa_ossl_private_encrypt(int flen, const unsigned char *from, goto err; if (padding == RSA_X931_PADDING) { - BN_sub(f, rsa->n, ret); + if (!BN_sub(f, rsa->n, ret)) + goto err; if (BN_cmp(ret, f) > 0) res = f; else