aboutsummaryrefslogtreecommitdiffstats
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 19:07:03 +0900
commit91d04f991f8b9910efea7bbe5aecb0fea2bbd5fa (patch)
tree61d6b3f1209b6afb9251866ad6454ed1f7d3ab8f
parent5d0df4027eec069ad5e169328ea2c67eaf7bfa73 (diff)
downloadruby-openssl-91d04f991f8b9910efea7bbe5aecb0fea2bbd5fa.tar.gz
cipher: update test_ciphers
Do not attempt to actually use all algorithms. Not all algorithms listed in OpenSSL::Cipher.ciphers are always available.
-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 6d18c0c8..b5fdf0b3 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