diff options
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), |