diff options
author | Simon Chopin <simon.chopin@canonical.com> | 2022-04-11 16:25:39 +0200 |
---|---|---|
committer | Florian Wininger <fw.centrale@gmail.com> | 2022-04-29 14:42:49 +0200 |
commit | 8729d47045bbca7eca266a353af18d857994cc5d (patch) | |
tree | b00f1e7756284aac6815b75e0f84480cf264fed3 /test/authentication/test_agent.rb | |
parent | 4de6831dea4e922bf3052192eec143af015a3486 (diff) | |
download | net-ssh-8729d47045bbca7eca266a353af18d857994cc5d.tar.gz |
Use OpenSSL::PKey::EC.generate static method
Migrate all instances of the pattern EC.new(foo).generate_key to
EC.generate(foo), as the old pattern isn't supported when using OpenSSL
3.0, since one is not allowed to mess with the internal data of already
created objects now.
The new API has been introduced in Ruby 2.4.
Co-authored-by: Lucas Kanashiro <lucas.kanashiro@canonical.com>
Diffstat (limited to 'test/authentication/test_agent.rb')
-rw-r--r-- | test/authentication/test_agent.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/authentication/test_agent.rb b/test/authentication/test_agent.rb index 0c15b1d..82d30f3 100644 --- a/test/authentication/test_agent.rb +++ b/test/authentication/test_agent.rb @@ -292,7 +292,7 @@ module Authentication end def test_add_ecdsa_identity - ecdsa = OpenSSL::PKey::EC.new("prime256v1").generate_key + ecdsa = OpenSSL::PKey::EC.generate("prime256v1") socket.expect do |s, type, buffer| assert_equal SSH2_AGENT_ADD_IDENTITY, type assert_equal buffer.read_string, "ecdsa-sha2-nistp256" @@ -309,7 +309,7 @@ module Authentication end def test_add_ecdsa_cert_identity - cert = make_cert(OpenSSL::PKey::EC.new("prime256v1").generate_key) + cert = make_cert(OpenSSL::PKey::EC.generate("prime256v1")) socket.expect do |s, type, buffer| assert_equal SSH2_AGENT_ADD_IDENTITY, type assert_equal buffer.read_string, "ecdsa-sha2-nistp256-cert-v01@openssh.com" |