diff options
Diffstat (limited to 'ext/openssl/ossl_pkey_rsa.c')
-rw-r--r-- | ext/openssl/ossl_pkey_rsa.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c index 274c1dfcac..699383f683 100644 --- a/ext/openssl/ossl_pkey_rsa.c +++ b/ext/openssl/ossl_pkey_rsa.c @@ -40,6 +40,7 @@ rsa_instance(VALUE klass, RSA *rsa) if (!rsa) { return Qfalse; } + obj = NewPKey(klass); if (!(pkey = EVP_PKEY_new())) { return Qfalse; } @@ -47,7 +48,7 @@ rsa_instance(VALUE klass, RSA *rsa) EVP_PKEY_free(pkey); return Qfalse; } - WrapPKey(klass, obj, pkey); + SetPKey(obj, pkey); return obj; } @@ -61,10 +62,11 @@ ossl_rsa_new(EVP_PKEY *pkey) obj = rsa_instance(cRSA, RSA_new()); } else { + obj = NewPKey(cRSA); if (EVP_PKEY_type(pkey->type) != EVP_PKEY_RSA) { ossl_raise(rb_eTypeError, "Not a RSA key!"); } - WrapPKey(cRSA, obj, pkey); + SetPKey(obj, pkey); } if (obj == Qfalse) { ossl_raise(eRSAError, NULL); |