diff options
author | Mansour Ahmadi <m.ahmadi@northeastern.edu> | 2018-12-11 15:48:08 -0500 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-12-13 09:59:10 +0000 |
commit | 3b16099e0c8df1fd5094ad4490d87ab31516bf25 (patch) | |
tree | 9bf93477cba78079ab64334ecc28b19af2d1e752 | |
parent | 5db5edc99a8386516da06f8078e5134ccd65a64b (diff) |
add missing check for BN_mod_inverse
Fixes #7650
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7876)
(cherry picked from commit 55833a8de70589a5000044b6291e190f5a3826ae)
-rw-r--r-- | crypto/rsa/rsa_x931g.c | 2 |
1 files changed, 2 insertions, 0 deletions
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: |