summaryrefslogtreecommitdiff
path: root/test/openssl/test_cipher.rb
diff options
context:
space:
mode:
authorBart de Water <bartdewater@gmail.com>2020-04-19 11:14:36 -0400
committerKazuki Yamaguchi <k@rhe.jp>2020-05-13 15:47:51 +0900
commit0b2c70eaa1e8e41fcb6332b22b084dabb81e637c (patch)
treef12d0c69a0b21c56b0df53ecd4615e2d6418d1f0 /test/openssl/test_cipher.rb
parent3f8665fe0ed5331aa723ddecbf6ad3728931c08d (diff)
[ruby/openssl] Look up digest by name instead of constant
https://github.com/ruby/openssl/commit/b28fb2f05c
Diffstat (limited to 'test/openssl/test_cipher.rb')
-rw-r--r--test/openssl/test_cipher.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb
index f6ec498087..c21c8a5f11 100644
--- a/test/openssl/test_cipher.rb
+++ b/test/openssl/test_cipher.rb
@@ -36,8 +36,8 @@ class OpenSSL::TestCipher < OpenSSL::TestCase
cipher.pkcs5_keyivgen(pass, salt, num, "MD5")
s1 = cipher.update(pt) << cipher.final
- d1 = num.times.inject(pass + salt) {|out, _| OpenSSL::Digest::MD5.digest(out) }
- d2 = num.times.inject(d1 + pass + salt) {|out, _| OpenSSL::Digest::MD5.digest(out) }
+ d1 = num.times.inject(pass + salt) {|out, _| OpenSSL::Digest.digest('MD5', out) }
+ d2 = num.times.inject(d1 + pass + salt) {|out, _| OpenSSL::Digest.digest('MD5', out) }
key = (d1 + d2)[0, 24]
iv = (d1 + d2)[24, 8]
cipher = new_encryptor("DES-EDE3-CBC", key: key, iv: iv)