summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_asn1.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb
index e29bf438b9..94083f86e4 100644
--- a/test/openssl/test_asn1.rb
+++ b/test/openssl/test_asn1.rb
@@ -243,6 +243,17 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase
assert_equal(raw, asn1.to_der)
end
+ def test_cons_without_inf_length_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.to_der
+ end
+ end
+
def test_seq_infinite_length
begin
content = [ OpenSSL::ASN1::Null.new(nil),