diff options
author | Brent Cook <bcook@openbsd.org> | 2015-10-17 22:57:59 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2015-10-17 22:57:59 -0500 |
commit | a45e38e962a30307dd2034c2c032bd76333ebd2c (patch) | |
tree | d290d9f6ef87032b1cae22716acde57bf028814a /patches/rfc5280.c.patch | |
parent | e8c92100735f1e32d4b6f4a5a2670a0bf98ad1a8 (diff) | |
download | portable-a45e38e962a30307dd2034c2c032bd76333ebd2c.tar.gz portable-a45e38e962a30307dd2034c2c032bd76333ebd2c.tar.bz2 portable-a45e38e962a30307dd2034c2c032bd76333ebd2c.zip |
disable some tests with 32-bit time_t systems
Also disable use of _mkgmtime, it does not produce correct results.
Diffstat (limited to 'patches/rfc5280.c.patch')
-rw-r--r-- | patches/rfc5280.c.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/patches/rfc5280.c.patch b/patches/rfc5280.c.patch new file mode 100644 index 0000000..4281109 --- /dev/null +++ b/patches/rfc5280.c.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | --- tests/rfc5280time.c.orig Sat Oct 17 22:36:27 2015 | ||
2 | +++ tests/rfc5280time.c Sat Oct 17 22:44:25 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 = 2524607999, | ||
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 = 2524608000, | ||
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 = 2524607999, | ||
44 | }, | ||
45 | +#endif | ||
46 | { | ||
47 | .str = "700101000000Z", | ||
48 | .data = "700101000000Z", | ||
49 | @@ -273,14 +279,14 @@ | ||
50 | |||
51 | if ((i = X509_cmp_time(gt, &att->time)) != -1) { | ||
52 | fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", | ||
53 | - test_no, i, att->time); | ||
54 | + test_no, i, (long long)att->time); | ||
55 | goto done; | ||
56 | } | ||
57 | |||
58 | att->time--; | ||
59 | if ((i = X509_cmp_time(gt, &att->time)) != 1) { | ||
60 | fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", | ||
61 | - test_no, i, att->time); | ||
62 | + test_no, i, (long long)att->time); | ||
63 | goto done; | ||
64 | } | ||
65 | att->time++; | ||
66 | @@ -325,14 +331,14 @@ | ||
67 | |||
68 | if ((i = X509_cmp_time(ut, &att->time)) != -1) { | ||
69 | fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", | ||
70 | - test_no, i, att->time); | ||
71 | + test_no, i, (long long)att->time); | ||
72 | goto done; | ||
73 | } | ||
74 | |||
75 | att->time--; | ||
76 | if ((i = X509_cmp_time(ut, &att->time)) != 1) { | ||
77 | fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", | ||
78 | - test_no, i, att->time); | ||
79 | + test_no, i, (long long)att->time); | ||
80 | goto done; | ||
81 | } | ||
82 | att->time++; | ||