diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2021-05-31 11:44:05 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2021-10-23 13:38:36 +0900 |
commit | 37632a0ac635082e4ca9ca5b1c8da6b6770ff0ed (patch) | |
tree | 0b6aa176577bb7930dcc5c456bd634fc73ba2584 /test/openssl/utils.rb | |
parent | e353bcd1113187185e06eac64b5f63956c30e2d9 (diff) |
[ruby/openssl] test/openssl/utils: remove dup_public helper method
It uses deprecated PKey::{RSA,DSA,DH}#set_* methods, which will not
work with OpenSSL 3.0. The same can easily be achieved using
PKey#public_to_der regardless of the key kind.
https://github.com/ruby/openssl/commit/7b66eaa2db
Diffstat (limited to 'test/openssl/utils.rb')
-rw-r--r-- | test/openssl/utils.rb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb index 85b771dcee..ba2338ec12 100644 --- a/test/openssl/utils.rb +++ b/test/openssl/utils.rb @@ -306,32 +306,6 @@ class OpenSSL::PKeyTestCase < OpenSSL::TestCase assert_equal base.send(comp), test.send(comp) } end - - def dup_public(key) - case key - when OpenSSL::PKey::RSA - rsa = OpenSSL::PKey::RSA.new - rsa.set_key(key.n, key.e, nil) - rsa - when OpenSSL::PKey::DSA - dsa = OpenSSL::PKey::DSA.new - dsa.set_pqg(key.p, key.q, key.g) - dsa.set_key(key.pub_key, nil) - dsa - when OpenSSL::PKey::DH - dh = OpenSSL::PKey::DH.new - dh.set_pqg(key.p, nil, key.g) - dh - else - if defined?(OpenSSL::PKey::EC) && OpenSSL::PKey::EC === key - ec = OpenSSL::PKey::EC.new(key.group) - ec.public_key = key.public_key - ec - else - raise "unknown key type" - end - end - end end module OpenSSL::Certs |