From 1c7181d20003533fbe53f9505245812ae1646708 Mon Sep 17 00:00:00 2001 From: thekuwayama Date: Tue, 18 Jun 2019 04:47:25 +0900 Subject: fix RSA_HAS_PRIVATE to check that both `e` and `d` are not NULL --- ext/openssl/ossl_pkey_rsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/openssl/ossl_pkey_rsa.c') 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 -- cgit v1.2.3