File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,7 @@ def test_constants
45
45
assert_equal universal_tag_name , OpenSSL ::ASN1 ::UNIVERSAL_TAG_NAME
46
46
end
47
47
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
51
49
raw = [ %w{ 30 80 04 01 01 02 01 01 00 00 } . join ( "" ) ] . pack ( "H*" )
52
50
pp asn1 = OpenSSL ::ASN1 . decode ( raw )
53
51
@@ -66,6 +64,11 @@ def _test_parse_infinite_length_sequence # borrowed from Krypt
66
64
assert_equal ( raw , asn1 . to_der )
67
65
end
68
66
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
+
69
72
def test_constructive
70
73
oct = OpenSSL ::ASN1 ::OctetString . new ( "" )
71
74
assert_equal "\x04 \x00 " , oct . to_der
You can’t perform that action at this time.
0 commit comments