[前][次][番号順一覧][スレッド一覧]

ruby-changes:70368

From: Kazuki <ko1@a...>
Date: Tue, 21 Dec 2021 00:11:33 +0900 (JST)
Subject: [ruby-changes:70368] cfcdd2b4bd (master): [ruby/openssl] cipher: update test_ciphers

https://git.ruby-lang.org/ruby.git/commit/?id=cfcdd2b4bd

From cfcdd2b4bd6c2420ecc93a8f77e553b53595b7ef Mon Sep 17 00:00:00 2001
From: Kazuki Yamaguchi <k@r...>
Date: Sun, 24 Oct 2021 17:50:18 +0900
Subject: [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
---
 test/openssl/test_cipher.rb | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb
index 6d18c0c85c8..b5fdf0b3d11 100644
--- a/test/openssl/test_cipher.rb
+++ b/test/openssl/test_cipher.rb
@@ -135,14 +135,11 @@ class OpenSSL::TestCipher < OpenSSL::TestCase https://github.com/ruby/ruby/blob/trunk/test/openssl/test_cipher.rb#L135
   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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]