aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey_rsa.c
diff options
context:
space:
mode:
authorthekuwayama <thekuwayama@gmail.com>2019-06-18 04:47:25 +0900
committerthekuwayama <thekuwayama@gmail.com>2019-06-20 19:29:53 +0900
commit1c7181d20003533fbe53f9505245812ae1646708 (patch)
tree2a06880795c4832dfb519ae052faf1ddc84923f8 /ext/openssl/ossl_pkey_rsa.c
parentfa56563314b6fac1404364c834a2fabd08cdb7ac (diff)
downloadruby-openssl-1c7181d20003533fbe53f9505245812ae1646708.tar.gz
fix RSA_HAS_PRIVATE to check that both `e` and `d` are not NULL
Diffstat (limited to 'ext/openssl/ossl_pkey_rsa.c')
-rw-r--r--ext/openssl/ossl_pkey_rsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 4800fb27..69dcfba1 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -26,10 +26,10 @@
static inline int
RSA_HAS_PRIVATE(RSA *rsa)
{
- const BIGNUM *p, *q;
+ const BIGNUM *e, *d;
- RSA_get0_factors(rsa, &p, &q);
- return p && q; /* d? why? */
+ RSA_get0_key(rsa, NULL, &e, &d);
+ return e && d;
}
static inline int