summaryrefslogtreecommitdiff
path: root/test/openssl/test_pkcs7.rb
diff options
context:
space:
mode:
authoremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-29 01:27:17 +0000
committeremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-29 01:27:17 +0000
commitaad347f5ec7f32c55dea663b3216f4bead993c9a (patch)
treec27f51d1505744edaf70c69ca6ee63e22486f8a2 /test/openssl/test_pkcs7.rb
parent8e601a20f4a41bc1016c3c0a45fd9cbd1840e158 (diff)
* ext/openssl/ossl_pkcs7.c: fix crash when parsing garbage data.
* test/openssl/test_pkcs7.rb: assert correct behavior for it. Thanks to Matt Venables for reporting the issue. [ruby-core:43250][Bug #6134] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/test_pkcs7.rb')
-rw-r--r--test/openssl/test_pkcs7.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/openssl/test_pkcs7.rb b/test/openssl/test_pkcs7.rb
index 34c523aacc..b17cbda0b2 100644
--- a/test/openssl/test_pkcs7.rb
+++ b/test/openssl/test_pkcs7.rb
@@ -146,6 +146,11 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
assert_equal(3, recip[1].serial)
assert_equal(data, p7.decrypt(@rsa1024, @ee2_cert))
end
+
+ def test_graceful_parsing_failure #[ruby-core:43250]
+ contents = File.read(__FILE__)
+ assert_raise(ArgumentError) { OpenSSL::PKCS7.new(contents) }
+ end
end
end