From 787d0e32547475d20747b64bf96c9ad238ec66a0 Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Sun, 30 Oct 2005 20:50:48 +0000 Subject: * ext/openssl/ossl_cipher.c (ossl_cipher_update): input data must not be empty. [ruby-talk:161220] * test/openssl/test_cipher.rb: add test for Cipher#update(""). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/openssl/test_cipher.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/openssl') diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb index 8711e46aa2..c84b47b7f4 100644 --- a/test/openssl/test_cipher.rb +++ b/test/openssl/test_cipher.rb @@ -57,6 +57,11 @@ class OpenSSL::TestCipher < Test::Unit::TestCase s2 = @c1.update(@data) + @c1.final assert_equal(s1, s2, "encrypt reset") end + + def test_empty_data + @c1.encrypt + assert_raises(ArgumentError){ @c1.update("") } + end end end -- cgit v1.2.3