aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey_rsa.c
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-03-16 16:06:53 +0900
committerKazuki Yamaguchi <k@rhe.jp>2020-05-13 16:14:06 +0900
commit94aeab2f265d07e20e89eff00a6145403ed1253f (patch)
tree487ec2e47cd82ab5fc0321b386a5490cdc4db8c6 /ext/openssl/ossl_pkey_rsa.c
parent41587f69e17b9f0983c1f2a37b8661599119fc0e (diff)
downloadruby-openssl-94aeab2f265d07e20e89eff00a6145403ed1253f.tar.gz
pkey: simplify ossl_pkey_new()
ossl_{rsa,dsa,dh,ec}_new() called from this function are not used anywhere else. Inline them into pkey_new0() and reduce code duplication.
Diffstat (limited to 'ext/openssl/ossl_pkey_rsa.c')
-rw-r--r--ext/openssl/ossl_pkey_rsa.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 761866c6..c1ae44fe 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -69,28 +69,6 @@ rsa_instance(VALUE klass, RSA *rsa)
return obj;
}
-VALUE
-ossl_rsa_new(EVP_PKEY *pkey)
-{
- VALUE obj;
-
- if (!pkey) {
- obj = rsa_instance(cRSA, RSA_new());
- }
- else {
- obj = NewPKey(cRSA);
- if (EVP_PKEY_base_id(pkey) != EVP_PKEY_RSA) {
- ossl_raise(rb_eTypeError, "Not a RSA key!");
- }
- SetPKey(obj, pkey);
- }
- if (obj == Qfalse) {
- ossl_raise(eRSAError, NULL);
- }
-
- return obj;
-}
-
/*
* Private
*/