diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2013-11-07 15:15:20 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2013-11-09 15:09:21 +0000 |
commit | 0ec1a77891e59647e1645631bc7cba294a605e1b (patch) | |
tree | acfc962d375cb42427c0a60de1e15a6d7ab90aaa /crypto | |
parent | 62c2b6d9445377d6b765ce7c905a071df9d7eade (diff) |
Check for missing components in RSA_check.
(cherry picked from commit 01be36ef70525e81fc358d2e559bdd0a0d9427a5)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/rsa/rsa_chk.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/rsa/rsa_chk.c b/crypto/rsa/rsa_chk.c index 9d848db8c6..cc30e77132 100644 --- a/crypto/rsa/rsa_chk.c +++ b/crypto/rsa/rsa_chk.c @@ -59,6 +59,12 @@ int RSA_check_key(const RSA *key) BN_CTX *ctx; int r; int ret=1; + + if (!key->p || !key->q || !key->n || !key->e || !key->d) + { + RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_VALUE_MISSING); + return 0; + } i = BN_new(); j = BN_new(); |