diff options
author | Bart de Water <bartdewater@gmail.com> | 2020-04-19 16:14:34 -0400 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2020-05-13 15:47:51 +0900 |
commit | c85789f9b2882bc95364c5da182a24aa72ca52cc (patch) | |
tree | be5b2b482d033753123693b2cf8eb528a8622384 /test/openssl/test_cipher.rb | |
parent | b44cc9f040f17fe1d19fb161a22e2df94c5ad76a (diff) | |
download | ruby-c85789f9b2882bc95364c5da182a24aa72ca52cc.tar.gz |
[ruby/openssl] Look up cipher by name instead of constant
https://github.com/ruby/openssl/commit/b08ae7e73d
Diffstat (limited to 'test/openssl/test_cipher.rb')
-rw-r--r-- | test/openssl/test_cipher.rb | 6 |
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 |