From 94aeab2f265d07e20e89eff00a6145403ed1253f Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Thu, 16 Mar 2017 16:06:53 +0900 Subject: 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. --- ext/openssl/ossl_pkey_rsa.c | 22 ---------------------- 1 file changed, 22 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 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 */ -- cgit v1.2.3