summaryrefslogtreecommitdiff
path: root/test/openssl/test_asn1.rb
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-10 08:12:02 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-10 08:12:02 +0000
commit0c83666c6ceb9dae06055150da02d16ed20f4781 (patch)
tree05cb0b815f8e891636940286391ecaf105155eb1 /test/openssl/test_asn1.rb
parent8e1293730e372b0cb5ebad818129f7bbe295477d (diff)
downloadruby-0c83666c6ceb9dae06055150da02d16ed20f4781.tar.gz
openssl: import v2.0.1
Import Ruby/OpenSSL 2.0.1. The full commit history since 2.0.0 (imported at r56946) can be found at: https://github.com/ruby/openssl/compare/v2.0.0...v2.0.1 This release contains only bug fixes. Note, the first two commits since v2.0.0 are already imported at r56953 to make Travis and RubyCI green. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/test_asn1.rb')
-rw-r--r--test/openssl/test_asn1.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb
index 3a43541447..a0ac1ddbf5 100644
--- a/test/openssl/test_asn1.rb
+++ b/test/openssl/test_asn1.rb
@@ -275,6 +275,14 @@ rEzBQ0F9dUyqQ9gyRg8KHhDfv9HzT1d/rnUZMkoombwYBRIUChGCYV0GnJcan2Zm
assert_equal 2 ** 31, OpenSSL::ASN1.decode(encoded).value.to_i
end
+ def test_decode_generalisedtime
+ expected = Time.at 1481225640
+ assert_equal expected, OpenSSL::ASN1.decode("\x18\x0D201612081934Z").value
+
+ expected += 29
+ assert_equal expected, OpenSSL::ASN1.decode("\x18\x0F20161208193429Z").value
+ end
+
def test_decode_enumerated
encoded = OpenSSL::ASN1.Enumerated(0).to_der
assert_equal "\x0a\x01\x00".b, encoded