aboutsummaryrefslogtreecommitdiff
path: root/patches/rfc5280.c.patch
blob: 92621836faf04e0f83e77a6fa9c96bb3b4e117c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
--- tests/rfc5280time.c.orig	Mon Nov  2 20:00:31 2015
+++ tests/rfc5280time.c	Mon Nov  2 20:03:12 2015
@@ -91,6 +91,7 @@
 		.data = "20150923032700Z",
 		.time = 1442978820,
 	},
+#if SIZEOF_TIME_T == 8
 	{
 		/* (times before 2050 must be UTCTIME) Per RFC 5280 4.1.2.5 */
 		.str = "00000101000000Z",
@@ -103,6 +104,7 @@
 		.data = "20491231235959Z",
 		.time = 2524607999LL,
 	},
+#endif
 	{
 		/* (times before 2050 must be UTCTIME) Per RFC 5280 4.1.2.5 */
 		.str = "19500101000000Z",
@@ -112,6 +114,7 @@
 };
 
 struct rfc5280_time_test rfc5280_gentime_tests[] = {
+#if SIZEOF_TIME_T == 8
 	{
 		/* Biggest RFC 5280 time */
 		.str = "99991231235959Z",
@@ -129,6 +132,7 @@
 		.data = "20500101000000Z",
 		.time =  2524608000LL,
 	},
+#endif
 };
 struct rfc5280_time_test rfc5280_utctime_tests[] = {
 	{
@@ -141,11 +145,13 @@
 		.data = "540226230640Z",
 		.time = -500000000,
 	},
+#if SIZEOF_TIME_T == 8
 	{
 		.str = "491231235959Z",
 		.data = "491231235959Z",
 		.time = 2524607999LL,
 	},
+#endif
 	{
 		.str = "700101000000Z",
 		.data = "700101000000Z",
@@ -273,14 +279,14 @@
 
 	if ((i = X509_cmp_time(gt, &att->time)) != -1) {
 		fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n",
-		    test_no, i, att->time);
+		    test_no, i, (long long)att->time);
 		goto done;
 	}
 
 	att->time--;
 	if ((i = X509_cmp_time(gt, &att->time)) != 1) {
 		fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n",
-		    test_no, i, att->time);
+		    test_no, i, (long long)att->time);
 		goto done;
 	}
 	att->time++;
@@ -325,14 +331,14 @@
 
 	if ((i = X509_cmp_time(ut, &att->time)) != -1) {
 		fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n",
-		    test_no, i, att->time);
+		    test_no, i, (long long)att->time);
 		goto done;
 	}
 
 	att->time--;
 	if ((i = X509_cmp_time(ut, &att->time)) != 1) {
 		fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n",
-		    test_no, i, att->time);
+		    test_no, i, (long long)att->time);
 		goto done;
 	}
 	att->time++;