diff options
author | Theo Buehler <tb@openbsd.org> | 2024-05-26 07:23:36 +0200 |
---|---|---|
committer | Theo Buehler <tb@openbsd.org> | 2024-05-26 07:44:05 +0200 |
commit | 1fec7bea51f6537276aef9d5d95d67b11d7be907 (patch) | |
tree | 4514d0898d5073e3ed92ec30ebf13b4e377a2d50 | |
parent | 8f03828942b063f3d7693fdaf3eb11ae77714d50 (diff) | |
download | portable-1fec7bea51f6537276aef9d5d95d67b11d7be907.tar.gz portable-1fec7bea51f6537276aef9d5d95d67b11d7be907.tar.bz2 portable-1fec7bea51f6537276aef9d5d95d67b11d7be907.zip |
Make RFC 5280 test xfail on 32-bit time_t systems
-rw-r--r-- | patches/rfc5280.c.patch | 48 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rwxr-xr-x | tests/rfc5280time_small.test | 10 |
4 files changed, 19 insertions, 48 deletions
diff --git a/patches/rfc5280.c.patch b/patches/rfc5280.c.patch deleted file mode 100644 index 9807f00..0000000 --- a/patches/rfc5280.c.patch +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | --- tests/rfc5280time.c.orig Mon Nov 2 20:00:31 2015 | ||
2 | +++ tests/rfc5280time.c Mon Nov 2 20:03:12 2015 | ||
3 | @@ -91,6 +91,7 @@ | ||
4 | .data = "20150923032700Z", | ||
5 | .time = 1442978820, | ||
6 | }, | ||
7 | +#if SIZEOF_TIME_T == 8 | ||
8 | { | ||
9 | /* (times before 2050 must be UTCTIME) Per RFC 5280 4.1.2.5 */ | ||
10 | .str = "00000101000000Z", | ||
11 | @@ -103,6 +104,7 @@ | ||
12 | .data = "20491231235959Z", | ||
13 | .time = 2524607999LL, | ||
14 | }, | ||
15 | +#endif | ||
16 | { | ||
17 | /* (times before 2050 must be UTCTIME) Per RFC 5280 4.1.2.5 */ | ||
18 | .str = "19500101000000Z", | ||
19 | @@ -112,6 +114,7 @@ | ||
20 | }; | ||
21 | |||
22 | struct rfc5280_time_test rfc5280_gentime_tests[] = { | ||
23 | +#if SIZEOF_TIME_T == 8 | ||
24 | { | ||
25 | /* Biggest RFC 5280 time */ | ||
26 | .str = "99991231235959Z", | ||
27 | @@ -129,6 +132,7 @@ | ||
28 | .data = "20500101000000Z", | ||
29 | .time = 2524608000LL, | ||
30 | }, | ||
31 | +#endif | ||
32 | }; | ||
33 | struct rfc5280_time_test rfc5280_utctime_tests[] = { | ||
34 | { | ||
35 | @@ -141,11 +145,13 @@ | ||
36 | .data = "540226230640Z", | ||
37 | .time = -500000000, | ||
38 | }, | ||
39 | +#if SIZEOF_TIME_T == 8 | ||
40 | { | ||
41 | .str = "491231235959Z", | ||
42 | .data = "491231235959Z", | ||
43 | .time = 2524607999LL, | ||
44 | }, | ||
45 | +#endif | ||
46 | { | ||
47 | .str = "700101000000Z", | ||
48 | .data = "700101000000Z", | ||
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3497cb5..f39eb20 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -588,6 +588,9 @@ add_test(rfc3779 rfc3779) | |||
588 | add_executable(rfc5280time rfc5280time.c) | 588 | add_executable(rfc5280time rfc5280time.c) |
589 | target_link_libraries(rfc5280time ${OPENSSL_TEST_LIBS}) | 589 | target_link_libraries(rfc5280time ${OPENSSL_TEST_LIBS}) |
590 | add_test(rfc5280time rfc5280time) | 590 | add_test(rfc5280time rfc5280time) |
591 | if(SMALL_TIME_T) | ||
592 | set_property(TEST rfc5280time PROPERTY WILL_FAIL TRUE) | ||
593 | endif() | ||
591 | 594 | ||
592 | # rmd_test | 595 | # rmd_test |
593 | add_executable(rmd_test rmd_test.c) | 596 | add_executable(rmd_test rmd_test.c) |
diff --git a/tests/Makefile.am b/tests/Makefile.am index 0e19106..629dbcb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
@@ -624,7 +624,13 @@ rfc3779_SOURCES = rfc3779.c | |||
624 | # rfc5280time | 624 | # rfc5280time |
625 | check_PROGRAMS += rfc5280time | 625 | check_PROGRAMS += rfc5280time |
626 | rfc5280time_SOURCES = rfc5280time.c | 626 | rfc5280time_SOURCES = rfc5280time.c |
627 | if SMALL_TIME_T | ||
628 | TESTS += rfc5280time_small.test | ||
629 | XFAIL_TESTS += rfc5280time_small.test | ||
630 | else | ||
627 | TESTS += rfc5280time | 631 | TESTS += rfc5280time |
632 | endif | ||
633 | EXTRA_DIST += rfc5280time_small.test | ||
628 | 634 | ||
629 | # rmd_test | 635 | # rmd_test |
630 | TESTS += rmd_test | 636 | TESTS += rmd_test |
diff --git a/tests/rfc5280time_small.test b/tests/rfc5280time_small.test new file mode 100755 index 0000000..61e5a05 --- /dev/null +++ b/tests/rfc5280time_small.test | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/bin/sh | ||
2 | echo 1..1 | ||
3 | TEST=./rfc5280 | ||
4 | if [ -e ./rfc5280.exe ]; then | ||
5 | TEST=./rfc5280.exe | ||
6 | fi | ||
7 | |||
8 | # map test failure to XFAIL and success to XPASS | ||
9 | $TEST || echo -n "not " | ||
10 | echo "ok # this system is unable to represent times past 2038" | ||