diff options
author | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-31 14:10:11 +0000 |
---|---|---|
committer | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-31 14:10:11 +0000 |
commit | 1978ce784b44e9e0ff376779629714cbad3dd756 (patch) | |
tree | c18b5eb1e5162255c621a817d10b6e90484e453a | |
parent | dd1be236d982b660cae84c1b0ea42f2869c102ad (diff) | |
download | ruby-1978ce784b44e9e0ff376779629714cbad3dd756.tar.gz |
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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/openssl/test_asn1.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb index 9db9ec510b..96c0859cfc 100644 --- a/test/openssl/test_asn1.rb +++ b/test/openssl/test_asn1.rb @@ -272,6 +272,14 @@ rEzBQ0F9dUyqQ9gyRg8KHhDfv9HzT1d/rnUZMkoombwYBRIUChGCYV0GnJcan2Zm 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*') |