diff options
author | emboss <emboss@ruby-lang.org> | 2011-05-22 22:00:24 +0000 |
---|---|---|
committer | emboss <emboss@ruby-lang.org> | 2011-05-22 22:00:24 +0000 |
commit | 992c85a79d7f855d8232f31972f57702a4bbf919 (patch) | |
tree | e09fe6e6b4c883ae58499407ecbb1262e7d8c8fe /test | |
parent | 6602e8e0ed32f9c95571495b6418ae54c7caa898 (diff) | |
download | ruby-openssl-history-992c85a79d7f855d8232f31972f57702a4bbf919.tar.gz |
* ext/openssl/ossl_asn1.c: Forbid Constructives whose value is not an
Array to prevent segfault. Added test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/test_asn1.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_asn1.rb b/test/test_asn1.rb index 94083f8..0122e0f 100644 --- a/test/test_asn1.rb +++ b/test/test_asn1.rb @@ -254,6 +254,18 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase end end + def test_cons_without_array_forbidden + assert_raise(OpenSSL::ASN1::ASN1Error) do + val = OpenSSL::ASN1::OctetString.new('a') + cons = OpenSSL::ASN1::Constructive.new(val, + OpenSSL::ASN1::OCTET_STRING, + nil, + :UNIVERSAL) + cons.infinite_length = true + cons.to_der + end + end + def test_seq_infinite_length begin content = [ OpenSSL::ASN1::Null.new(nil), |