Skip to content

Commit bbc540f

Browse files
committed
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
1 parent fd40742 commit bbc540f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/openssl/test_asn1.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,16 +404,17 @@ def test_set
404404
def test_utctime
405405
encode_decode_test B(%w{ 17 0D }) + "160908234339Z".b,
406406
OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 39))
407-
# Seconds is omitted
408-
decode_test B(%w{ 17 0B }) + "1609082343Z".b,
409-
OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 0))
410407
begin
411408
# possible range of UTCTime is 1969-2068 currently
412409
encode_decode_test B(%w{ 17 0D }) + "690908234339Z".b,
413410
OpenSSL::ASN1::UTCTime.new(Time.utc(1969, 9, 8, 23, 43, 39))
414411
rescue OpenSSL::ASN1::ASN1Error
415412
pend "No negative time_t support?"
416413
end
414+
# Seconds is omitted. LibreSSL 3.6.0 requires it
415+
return if libressl?
416+
decode_test B(%w{ 17 0B }) + "1609082343Z".b,
417+
OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 0))
417418
# not implemented
418419
# decode_test B(%w{ 17 11 }) + "500908234339+0930".b,
419420
# OpenSSL::ASN1::UTCTime.new(Time.new(1950, 9, 8, 23, 43, 39, "+09:30"))
@@ -432,6 +433,8 @@ def test_generalizedtime
432433
OpenSSL::ASN1::GeneralizedTime.new(Time.utc(2016, 12, 8, 19, 34, 29))
433434
encode_decode_test B(%w{ 18 0F }) + "99990908234339Z".b,
434435
OpenSSL::ASN1::GeneralizedTime.new(Time.utc(9999, 9, 8, 23, 43, 39))
436+
# LibreSSL 3.6.0 requires the seconds element
437+
return if libressl?
435438
decode_test B(%w{ 18 0D }) + "201612081934Z".b,
436439
OpenSSL::ASN1::GeneralizedTime.new(Time.utc(2016, 12, 8, 19, 34, 0))
437440
# not implemented

0 commit comments

Comments
 (0)