summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authorBart de Water <bartdewater@gmail.com>2020-04-19 16:14:34 -0400
committerKazuki Yamaguchi <k@rhe.jp>2020-05-13 15:47:51 +0900
commitc85789f9b2882bc95364c5da182a24aa72ca52cc (patch)
treebe5b2b482d033753123693b2cf8eb528a8622384 /test/openssl
parentb44cc9f040f17fe1d19fb161a22e2df94c5ad76a (diff)
[ruby/openssl] Look up cipher by name instead of constant
https://github.com/ruby/openssl/commit/b08ae7e73d
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_cipher.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb
index c21c8a5f11..178f5aba0e 100644
--- a/test/openssl/test_cipher.rb
+++ b/test/openssl/test_cipher.rb
@@ -148,12 +148,12 @@ class OpenSSL::TestCipher < OpenSSL::TestCase
def test_AES
pt = File.read(__FILE__)
%w(ECB CBC CFB OFB).each{|mode|
- c1 = OpenSSL::Cipher::AES256.new(mode)
+ c1 = OpenSSL::Cipher.new("AES-256-#{mode}")
c1.encrypt
c1.pkcs5_keyivgen("passwd")
ct = c1.update(pt) + c1.final
- c2 = OpenSSL::Cipher::AES256.new(mode)
+ c2 = OpenSSL::Cipher.new("AES-256-#{mode}")
c2.decrypt
c2.pkcs5_keyivgen("passwd")
assert_equal(pt, c2.update(ct) + c2.final)
@@ -163,7 +163,7 @@ class OpenSSL::TestCipher < OpenSSL::TestCase
def test_update_raise_if_key_not_set
assert_raise(OpenSSL::Cipher::CipherError) do
# it caused OpenSSL SEGV by uninitialized key [Bug #2768]
- OpenSSL::Cipher::AES128.new("ECB").update "." * 17
+ OpenSSL::Cipher.new("AES-128-ECB").update "." * 17
end
end