From b995eee81183c793c36ad87715e23d2e96bd8f5f Mon Sep 17 00:00:00 2001 From: Samuel Chiang Date: Wed, 12 Feb 2025 01:37:17 +0000 Subject: [PATCH] [ruby/openssl] 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). https://github.com/ruby/openssl/commit/c73d9985ab --- test/openssl/test_asn1.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb index 354b587895..869ecc0635 100644 --- a/test/openssl/test_asn1.rb +++ b/test/openssl/test_asn1.rb @@ -458,7 +458,7 @@ class OpenSSL::TestASN1 < OpenSSL::TestCase encode_decode_test B(%w{ 81 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 1, :CONTEXT_SPECIFIC) encode_decode_test B(%w{ C1 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 1, :PRIVATE) encode_decode_test B(%w{ 1F 20 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 32, :UNIVERSAL) - encode_decode_test B(%w{ 1F C0 20 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 8224, :UNIVERSAL) + encode_decode_test B(%w{ 9F C0 20 00 }), OpenSSL::ASN1::ASN1Data.new(B(%w{}), 8224, :CONTEXT_SPECIFIC) encode_decode_test B(%w{ 41 02 AB CD }), OpenSSL::ASN1::ASN1Data.new(B(%w{ AB CD }), 1, :APPLICATION) encode_decode_test B(%w{ 41 81 80 } + %w{ AB CD } * 64), OpenSSL::ASN1::ASN1Data.new(B(%w{ AB CD } * 64), 1, :APPLICATION) encode_decode_test B(%w{ 41 82 01 00 } + %w{ AB CD } * 128), OpenSSL::ASN1::ASN1Data.new(B(%w{ AB CD } * 128), 1, :APPLICATION)