aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2022-10-17 16:50:01 +0900
committerKazuki Yamaguchi <k@rhe.jp>2022-12-23 03:43:46 +0900
commitbbc540fe83195e2a54cf40fab448cea2afe4df1d (patch)
treefbf26f972ac755cda6582466f40db6a0fa0136c8 /test
parentfd40742358775bef7d893c49cf1000b906869908 (diff)
downloadruby-openssl-bbc540fe83195e2a54cf40fab448cea2afe4df1d.tar.gz
test/openssl/test_asn1.rb: skip failing tests on LibreSSL 3.6.0
LibreSSL 3.6.0 expects the seconds part in UTCTime and GeneralizedTime to be always present. LibreSSL 3.6.0 release note [1] says: > - The ASN.1 time parser has been refactored and rewritten using CBS. > It has been made stricter in that it now enforces the rules from > RFC 5280. [1] https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.6.0-relnotes.txt
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_asn1.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb
index c79bc142..f17ba98d 100644
--- a/test/openssl/test_asn1.rb
+++ b/test/openssl/test_asn1.rb
@@ -404,9 +404,6 @@ class OpenSSL::TestASN1 < OpenSSL::TestCase
def test_utctime
encode_decode_test B(%w{ 17 0D }) + "160908234339Z".b,
OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 39))
- # Seconds is omitted
- decode_test B(%w{ 17 0B }) + "1609082343Z".b,
- OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 0))
begin
# possible range of UTCTime is 1969-2068 currently
encode_decode_test B(%w{ 17 0D }) + "690908234339Z".b,
@@ -414,6 +411,10 @@ class OpenSSL::TestASN1 < OpenSSL::TestCase
rescue OpenSSL::ASN1::ASN1Error
pend "No negative time_t support?"
end
+ # Seconds is omitted. LibreSSL 3.6.0 requires it
+ return if libressl?
+ decode_test B(%w{ 17 0B }) + "1609082343Z".b,
+ OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 0))
# not implemented
# decode_test B(%w{ 17 11 }) + "500908234339+0930".b,
# OpenSSL::ASN1::UTCTime.new(Time.new(1950, 9, 8, 23, 43, 39, "+09:30"))
@@ -432,6 +433,8 @@ class OpenSSL::TestASN1 < OpenSSL::TestCase
OpenSSL::ASN1::GeneralizedTime.new(Time.utc(2016, 12, 8, 19, 34, 29))
encode_decode_test B(%w{ 18 0F }) + "99990908234339Z".b,
OpenSSL::ASN1::GeneralizedTime.new(Time.utc(9999, 9, 8, 23, 43, 39))
+ # LibreSSL 3.6.0 requires the seconds element
+ return if libressl?
decode_test B(%w{ 18 0D }) + "201612081934Z".b,
OpenSSL::ASN1::GeneralizedTime.new(Time.utc(2016, 12, 8, 19, 34, 0))
# not implemented