File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,7 @@ def test_constants
4545 assert_equal universal_tag_name , OpenSSL ::ASN1 ::UNIVERSAL_TAG_NAME
4646 end
4747
48- require 'pp'
49-
50- def _test_parse_infinite_length_sequence # borrowed from Krypt
48+ def _test_parse_infinite_length_sequence ; require 'pp' # borrowed from Krypt
5149 raw = [ %w{ 30 80 04 01 01 02 01 01 00 00 } . join ( "" ) ] . pack ( "H*" )
5250 pp asn1 = OpenSSL ::ASN1 . decode ( raw )
5351
@@ -66,6 +64,11 @@ def _test_parse_infinite_length_sequence # borrowed from Krypt
6664 assert_equal ( raw , asn1 . to_der )
6765 end
6866
67+ def test_simple_to_der
68+ assert_equal "0\x00 " , OpenSSL ::ASN1 ::Sequence . new ( nil ) . to_der
69+ assert_equal "1\x00 " , OpenSSL ::ASN1 ::Set . new ( nil ) . to_der
70+ end
71+
6972 def test_constructive
7073 oct = OpenSSL ::ASN1 ::OctetString . new ( "" )
7174 assert_equal "\x04 \x00 " , oct . to_der
You can’t perform that action at this time.
0 commit comments