[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
This commit is contained in:
parent
8ebf597885
commit
cfcdd2b4bd
@ -135,14 +135,11 @@ class OpenSSL::TestCipher < OpenSSL::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_ciphers
|
def test_ciphers
|
||||||
OpenSSL::Cipher.ciphers.each{|name|
|
ciphers = OpenSSL::Cipher.ciphers
|
||||||
next if /netbsd/ =~ RUBY_PLATFORM && /idea|rc5/i =~ name
|
assert_kind_of Array, ciphers
|
||||||
begin
|
assert_include ciphers, "aes-128-cbc"
|
||||||
assert_kind_of(OpenSSL::Cipher, OpenSSL::Cipher.new(name))
|
assert_include ciphers, "aes128" # alias of aes-128-cbc
|
||||||
rescue OpenSSL::Cipher::CipherError => e
|
assert_include ciphers, "aes-128-gcm"
|
||||||
raise unless /wrap/ =~ name and /wrap mode not allowed/ =~ e.message
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_AES
|
def test_AES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user