@@ -553,27 +553,19 @@ def test_basic_primitive
553553 #
554554
555555 def test_basic_constructed
556- #octet_string = OpenSSL::ASN1::OctetString.new(B(%w{ AB CD }))
557- # TODO: Import Issue
558- # OpenSSL::ASN1::ASN1Error: Constructive shall only be used with indefinite length
559- #encode_test B(%w{ 20 00 }), OpenSSL::ASN1::Constructive.new([], 0)
560- #encode_test B(%w{ 21 00 }), OpenSSL::ASN1::Constructive.new([], 1, nil, :UNIVERSAL)
561- #encode_test B(%w{ A1 00 }), OpenSSL::ASN1::Constructive.new([], 1, nil, :CONTEXT_SPECIFIC)
562- #encode_test B(%w{ 21 04 04 02 AB CD }), OpenSSL::ASN1::Constructive.new([octet_string], 1)
563- # Java::JavaLang::UnsupportedOperationException:
564- # #<OpenSSL::ASN1::Constructive:0x4fc256ec @tag=1, @value=[#<OpenSSL::ASN1::OctetString:0x7fc56d61
565- # @tag=4, @value="\xAB\xCD", @tag_class=:UNIVERSAL, @tagging=nil, @indefinite_length=false>],
566- # @tag_class=:CONTEXT_SPECIFIC, @tagging=:EXPLICIT, @indefinite_length=true>
567- # org.jruby.ext.openssl.ASN1$Constructive.toDER(ASN1.java:1881)
568- # org.jruby.ext.openssl.ASN1$ASN1Data.to_der(ASN1.java:1414)
569- # org.jruby.ext.openssl.ASN1$Constructive.to_der(ASN1.java:1858)
570- #obj = OpenSSL::ASN1::Constructive.new([octet_string], 1)
571- #obj.indefinite_length = true
572- #encode_decode_test B(%w{ 21 80 04 02 AB CD 00 00 }), obj
573- # (see above) Java::JavaLang::UnsupportedOperationException
574- #obj = OpenSSL::ASN1::Constructive.new([octet_string, OpenSSL::ASN1::EndOfContent.new], 1)
575- #obj.indefinite_length = true
576- #encode_test B(%w{ 21 80 04 02 AB CD 00 00 }), obj
556+ octet_string = OpenSSL ::ASN1 ::OctetString . new ( B ( %w{ AB CD } ) )
557+ encode_test B ( %w{ 20 00 } ) , OpenSSL ::ASN1 ::Constructive . new ( [ ] , 0 )
558+ encode_test B ( %w{ 21 00 } ) , OpenSSL ::ASN1 ::Constructive . new ( [ ] , 1 , nil , :UNIVERSAL )
559+ encode_test B ( %w{ A1 00 } ) , OpenSSL ::ASN1 ::Constructive . new ( [ ] , 1 , nil , :CONTEXT_SPECIFIC )
560+ encode_test B ( %w{ 21 04 04 02 AB CD } ) , OpenSSL ::ASN1 ::Constructive . new ( [ octet_string ] , 1 )
561+ obj = OpenSSL ::ASN1 ::Constructive . new ( [ octet_string ] , 1 )
562+ obj . indefinite_length = true
563+ encode_test B ( %w{ 21 80 04 02 AB CD 00 00 } ) , obj
564+ # TODO: BC doesn't support decoding indef constructive asn1s from unsupported tag types.
565+ # encode_decode_test B(%w{ 21 80 04 02 AB CD 00 00 }), obj
566+ obj = OpenSSL ::ASN1 ::Constructive . new ( [ octet_string , OpenSSL ::ASN1 ::EndOfContent . new ] , 1 )
567+ obj . indefinite_length = true
568+ encode_test B ( %w{ 21 80 04 02 AB CD 00 00 } ) , obj
577569 end
578570
579571 def test_constructive
0 commit comments