Skip to content

Commit c73d998

Browse files
asn1: adjusting an ASN1 test to use CONTEXT_SPECIFIC
AWS-LC's ASN1 parsing capabilities led to us examine some of our ASN1 tests. One test in test_asn1.rb happens to use a tag number of 8224. There are concerns with larger UNIVERSAL tags being ambiguous with negative ASN1 Integers, so I've adjusted the test to use CONTEXT_SPECIFIC instead with the same tag number (8224).
1 parent e8de3bb commit c73d998

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/openssl/test_asn1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def test_basic_asn1data
458458
encode_decode_test B(%w{ 81 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 1, :CONTEXT_SPECIFIC)
459459
encode_decode_test B(%w{ C1 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 1, :PRIVATE)
460460
encode_decode_test B(%w{ 1F 20 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 32, :UNIVERSAL)
461-
encode_decode_test B(%w{ 1F C0 20 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 8224, :UNIVERSAL)
461+
encode_decode_test B(%w{ 9F C0 20 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 8224, :CONTEXT_SPECIFIC)
462462
encode_decode_test B(%w{ 41 02 AB CD }), OpenSSL::ASN1::ASN1Data.new(B(%w{ AB CD }), 1, :APPLICATION)
463463
encode_decode_test B(%w{ 41 81 80 } + %w{ AB CD } * 64), OpenSSL::ASN1::ASN1Data.new(B(%w{ AB CD } * 64), 1, :APPLICATION)
464464
encode_decode_test B(%w{ 41 82 01 00 } + %w{ AB CD } * 128), OpenSSL::ASN1::ASN1Data.new(B(%w{ AB CD } * 128), 1, :APPLICATION)

0 commit comments

Comments
 (0)