mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[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
1 changed files with 5 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue