diff options
author | emboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-22 22:00:24 +0000 |
---|---|---|
committer | emboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-22 22:00:24 +0000 |
commit | 7d6529a415457ccfc912d6b8ddbac327516ee5d5 (patch) | |
tree | 48193a0055e4df50773100f76be49f0ad44090de /test/openssl/test_asn1.rb | |
parent | a65d506d83ee126d59576e483bdb6699ec73bbe7 (diff) | |
download | ruby-7d6529a415457ccfc912d6b8ddbac327516ee5d5.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/openssl/test_asn1.rb')
-rw-r--r-- | test/openssl/test_asn1.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb index 94083f86e4..0122e0fdcb 100644 --- a/test/openssl/test_asn1.rb +++ b/test/openssl/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), |