summaryrefslogtreecommitdiff
path: root/test/authentication/test_key_manager.rb
diff options
context:
space:
mode:
authorSimon Chopin <simon.chopin@canonical.com>2022-04-11 16:25:39 +0200
committerFlorian Wininger <fw.centrale@gmail.com>2022-04-29 14:42:49 +0200
commit8729d47045bbca7eca266a353af18d857994cc5d (patch)
treeb00f1e7756284aac6815b75e0f84480cf264fed3 /test/authentication/test_key_manager.rb
parent4de6831dea4e922bf3052192eec143af015a3486 (diff)
downloadnet-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_key_manager.rb')
-rw-r--r--test/authentication/test_key_manager.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/authentication/test_key_manager.rb b/test/authentication/test_key_manager.rb
index 4368a08..7bbc0e5 100644
--- a/test/authentication/test_key_manager.rb
+++ b/test/authentication/test_key_manager.rb
@@ -330,15 +330,15 @@ module Authentication
end
def ecdsa_sha2_nistp256
- @ecdsa_sha2_nistp256 ||= OpenSSL::PKey::EC.new('prime256v1').generate_key
+ @ecdsa_sha2_nistp256 ||= OpenSSL::PKey::EC.generate('prime256v1')
end
def ecdsa_sha2_nistp384
- @ecdsa_sha2_nistp384 ||= OpenSSL::PKey::EC.new('secp384r1').generate_key
+ @ecdsa_sha2_nistp384 ||= OpenSSL::PKey::EC.generate('secp384r1')
end
def ecdsa_sha2_nistp521
- @ecdsa_sha2_nistp521 ||= OpenSSL::PKey::EC.new('secp521r1').generate_key
+ @ecdsa_sha2_nistp521 ||= OpenSSL::PKey::EC.generate('secp521r1')
end
def rsa_pk