From bdbef403a122237d032af0697d375f135f1a69a3 Mon Sep 17 00:00:00 2001 From: drbrain Date: Mon, 22 Jul 2013 23:44:53 +0000 Subject: * ext/openssl/ossl_asn1.c (asn1time_to_time): Implement YYMMDDhhmmZ format for ASN.1 UTCTime. [ruby-trunk - Bug #8664] * test/openssl/test_asn1.rb: Test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/openssl/test_asn1.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/openssl') diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb index 736655a30b..3ea2638b0b 100644 --- a/test/openssl/test_asn1.rb +++ b/test/openssl/test_asn1.rb @@ -263,6 +263,14 @@ rEzBQ0F9dUyqQ9gyRg8KHhDfv9HzT1d/rnUZMkoombwYBRIUChGCYV0GnJcan2Zm end end + def test_decode_utctime + expected = Time.at 1374535380 + assert_equal expected, OpenSSL::ASN1.decode("\x17\v1307222323Z").value + + expected += 17 + assert_equal expected, OpenSSL::ASN1.decode("\x17\r130722232317Z").value + end + def test_create_inf_length_primitive expected = %w{ 24 80 04 01 61 00 00 } raw = [expected.join('')].pack('H*') -- cgit v1.2.3