diff options
Diffstat (limited to 'ext/openssl/ossl_pkey_rsa.c')
-rw-r--r-- | ext/openssl/ossl_pkey_rsa.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c index e09813a4..761866c6 100644 --- a/ext/openssl/ossl_pkey_rsa.c +++ b/ext/openssl/ossl_pkey_rsa.c @@ -488,13 +488,13 @@ static VALUE ossl_rsa_private_encrypt(int argc, VALUE *argv, VALUE self) { RSA *rsa; - const BIGNUM *rsa_n, *rsa_d; + const BIGNUM *rsa_n; int buf_len, pad; VALUE str, buffer, padding; GetRSA(self, rsa); - RSA_get0_key(rsa, &rsa_n, NULL, &rsa_d); - if (!rsa_n || !rsa_d) + RSA_get0_key(rsa, &rsa_n, NULL, NULL); + if (!rsa_n) ossl_raise(eRSAError, "incomplete RSA"); if (!RSA_PRIVATE(self, rsa)) ossl_raise(eRSAError, "private key needed."); @@ -522,13 +522,13 @@ static VALUE ossl_rsa_private_decrypt(int argc, VALUE *argv, VALUE self) { RSA *rsa; - const BIGNUM *rsa_n, *rsa_d; + const BIGNUM *rsa_n; int buf_len, pad; VALUE str, buffer, padding; GetRSA(self, rsa); - RSA_get0_key(rsa, &rsa_n, NULL, &rsa_d); - if (!rsa_n || !rsa_d) + RSA_get0_key(rsa, &rsa_n, NULL, NULL); + if (!rsa_n) ossl_raise(eRSAError, "incomplete RSA"); if (!RSA_PRIVATE(self, rsa)) ossl_raise(eRSAError, "private key needed."); |