summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2021-10-24 17:50:18 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-12-20 23:42:02 +0900
commitcfcdd2b4bd6c2420ecc93a8f77e553b53595b7ef (patch)
treeb86f96ae49fd8be9650948afb8bdeafd8e2a153e /test/openssl
parent8ebf5978852e22358cbcdf74c0eb506f22e2c73f (diff)
[ruby/openssl] cipher: update test_ciphers
Do not attempt to actually use all algorithms. Not all algorithms listed in OpenSSL::Cipher.ciphers are always available. https://github.com/ruby/openssl/commit/91d04f991f
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_cipher.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb
index 6d18c0c85c..b5fdf0b3d1 100644
--- a/test/openssl/test_cipher.rb
+++ b/test/openssl/test_cipher.rb
@@ -135,14 +135,11 @@ class OpenSSL::TestCipher < OpenSSL::TestCase
end
def test_ciphers
- OpenSSL::Cipher.ciphers.each{|name|
- next if /netbsd/ =~ RUBY_PLATFORM && /idea|rc5/i =~ name
- begin
- assert_kind_of(OpenSSL::Cipher, OpenSSL::Cipher.new(name))
- rescue OpenSSL::Cipher::CipherError => e
- raise unless /wrap/ =~ name and /wrap mode not allowed/ =~ e.message
- end
- }
+ ciphers = OpenSSL::Cipher.ciphers
+ assert_kind_of Array, ciphers
+ assert_include ciphers, "aes-128-cbc"
+ assert_include ciphers, "aes128" # alias of aes-128-cbc
+ assert_include ciphers, "aes-128-gcm"
end
def test_AES