Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/test/ruby/test_cipher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -470,23 +470,19 @@ def test_encrypt_aes_cfb_20_incompatibility

def test_encrypt_aes_256_cbc_modifies_buffer
cipher = OpenSSL::Cipher.new("AES-256-CBC")
cipher.key = "a" * 32
cipher.encrypt
cipher.key = "a" * 32
buffer = ''
actual = cipher.update('bar' * 10, buffer)
if jruby?
expected = "\xE6\xD3Y\fc\xEE\xBA\xB2*\x0Fr\xD1\xC2b\x03\xD0"
else
expected = "8\xA7\xBE\xB1\xAE\x88j\xCB\xA3\xE9j\x00\xD2W_\x91"
end
expected = "\xE6\xD3Y\fc\xEE\xBA\xB2*\x0Fr\xD1\xC2b\x03\xD0"
assert_equal actual, expected
assert_equal buffer, expected
end

def test_encrypt_aes_256_cbc_invalid_buffer
cipher = OpenSSL::Cipher.new("AES-256-CBC")
cipher.key = "a" * 32
cipher.encrypt
cipher.key = "a" * 32
buffer = Object.new
assert_raise(TypeError) { cipher.update('bar' * 10, buffer) }
end
Expand Down
Loading