From: Mansour Ahmadi Date: Tue, 11 Dec 2018 20:48:08 +0000 (-0500) Subject: add missing check for BN_mod_inverse X-Git-Tag: OpenSSL_1_1_1b~117 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3b16099e0c8df1fd5094ad4490d87ab31516bf25;p=oweals%2Fopenssl.git add missing check for BN_mod_inverse Fixes #7650 Reviewed-by: Kurt Roeckx Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/7876) (cherry picked from commit 55833a8de70589a5000044b6291e190f5a3826ae) --- diff --git a/crypto/rsa/rsa_x931g.c b/crypto/rsa/rsa_x931g.c index 3563670a12..15e40e8d1d 100644 --- a/crypto/rsa/rsa_x931g.c +++ b/crypto/rsa/rsa_x931g.c @@ -128,6 +128,8 @@ int RSA_X931_derive_ex(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, /* calculate inverse of q mod p */ rsa->iqmp = BN_mod_inverse(NULL, rsa->q, rsa->p, ctx2); + if (rsa->iqmp == NULL) + goto err; ret = 1; err: