aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey_rsa.c
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2015-06-03 14:02:14 -0400
committerZachary Scott <e@zzak.io>2015-06-03 14:02:14 -0400
commit8706e768540ab7d556f1859f71d7ee3c8b40e25d (patch)
tree53b7f857ccada137d2678adaf0a5408873d35809 /ext/openssl/ossl_pkey_rsa.c
parentbd594af66966d8ab62e6963540b2caabc0cf3087 (diff)
downloadruby-openssl-8706e768540ab7d556f1859f71d7ee3c8b40e25d.tar.gz
Upstream ruby/ruby@451fe26 from r50673
Diffstat (limited to 'ext/openssl/ossl_pkey_rsa.c')
-rw-r--r--ext/openssl/ossl_pkey_rsa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 274c1dfc..699383f6 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);