ruby-changes:43155
From: rhe <ko1@a...>
Date: Tue, 31 May 2016 23:10:16 +0900 (JST)
Subject: [ruby-changes:43155] rhe:r55229 (trunk): openssl: add missing test for r55219
rhe 2016-05-31 23:10:11 +0900 (Tue, 31 May 2016) New Revision: 55229 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55229 Log: openssl: add missing test for r55219 * test/openssl/test_asn1.rb: Add missing regression test for r55219. It fixed the year 2038 issue but the test code was missing. [ruby-core:45552] [Bug #6571] Modified files: trunk/test/openssl/test_asn1.rb Index: test/openssl/test_asn1.rb =================================================================== --- test/openssl/test_asn1.rb (revision 55228) +++ test/openssl/test_asn1.rb (revision 55229) @@ -272,6 +272,14 @@ rEzBQ0F9dUyqQ9gyRg8KHhDfv9HzT1d/rnUZMkoo https://github.com/ruby/ruby/blob/trunk/test/openssl/test_asn1.rb#L272 assert_equal expected, OpenSSL::ASN1.decode("\x17\r130722232317Z").value end + def test_encode_utctime_2k38 + encoded = OpenSSL::ASN1::UTCTime(2 ** 31 - 1).to_der + assert_equal 2 ** 31 - 1, OpenSSL::ASN1.decode(encoded).value.to_i + + encoded = OpenSSL::ASN1::UTCTime(2 ** 31).to_der + assert_equal 2 ** 31, OpenSSL::ASN1.decode(encoded).value.to_i + end + def test_create_inf_length_primitive expected = %w{ 24 80 04 01 61 00 00 } raw = [expected.join('')].pack('H*') -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/