From 74e6dd4078051efea4144fd289dc4c2b30fc9891 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 5 Feb 2011 02:48:55 +0000 Subject: * ext/openssl/ossl_cipher.c (ossl_cipher_alloc): leave data ptr NULL. * ext/openssl/ossl_cipher.c (ossl_cipher_new, ossl_cipher_initialize): allocate internal structure. [ruby-core:35094] * ext/openssl/ossl_cipher.c (ossl_cipher_copy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/openssl/test_cipher.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb index 5cf41879bd..70c963bbb0 100644 --- a/test/openssl/test_cipher.rb +++ b/test/openssl/test_cipher.rb @@ -64,6 +64,11 @@ class OpenSSL::TestCipher < Test::Unit::TestCase assert_raise(ArgumentError){ @c1.update("") } end + def test_initialize + assert_raise(RuntimeError) {@c1.__send__(:initialize, "DES-EDE3-CBC")} + assert_raise(RuntimeError) {OpenSSL::Cipher.allocate.final} + end + if OpenSSL::OPENSSL_VERSION_NUMBER > 0x00907000 def test_ciphers OpenSSL::Cipher.ciphers.each{|name| -- cgit v1.2.3