diff options
Diffstat (limited to 'src/regress/lib/libcrypto/asn1/rfc5280time.c')
-rw-r--r-- | src/regress/lib/libcrypto/asn1/rfc5280time.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/regress/lib/libcrypto/asn1/rfc5280time.c b/src/regress/lib/libcrypto/asn1/rfc5280time.c index 34e40439dc..f9b561e5c9 100644 --- a/src/regress/lib/libcrypto/asn1/rfc5280time.c +++ b/src/regress/lib/libcrypto/asn1/rfc5280time.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rfc5280time.c,v 1.4 2015/10/30 15:52:55 miod Exp $ */ | 1 | /* $OpenBSD: rfc5280time.c,v 1.5 2022/09/05 21:06:31 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2015 Bob Beck <beck@opebsd.org> | 4 | * Copyright (c) 2015 Bob Beck <beck@opebsd.org> |
@@ -191,12 +191,12 @@ asn1_compare_str(int test_no, struct asn1_string_st *asn1str, const char *str) | |||
191 | int length = strlen(str); | 191 | int length = strlen(str); |
192 | 192 | ||
193 | if (asn1str->length != length) { | 193 | if (asn1str->length != length) { |
194 | fprintf(stderr, "FAIL: test %i - string lengths differ " | 194 | fprintf(stderr, "FAIL: test %d - string lengths differ " |
195 | "(%i != %i)\n", test_no, asn1str->length, length); | 195 | "(%d != %d)\n", test_no, asn1str->length, length); |
196 | return (1); | 196 | return (1); |
197 | } | 197 | } |
198 | if (strncmp(asn1str->data, str, length) != 0) { | 198 | if (strncmp(asn1str->data, str, length) != 0) { |
199 | fprintf(stderr, "FAIL: test %i - strings differ " | 199 | fprintf(stderr, "FAIL: test %d - strings differ " |
200 | "('%s' != '%s')\n", test_no, asn1str->data, str); | 200 | "('%s' != '%s')\n", test_no, asn1str->data, str); |
201 | return (1); | 201 | return (1); |
202 | } | 202 | } |
@@ -222,21 +222,21 @@ rfc5280_invtime_test(int test_no, struct rfc5280_time_test *att) | |||
222 | 222 | ||
223 | if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 0) { | 223 | if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 0) { |
224 | if (X509_cmp_time(gt, &now) != 0) { | 224 | if (X509_cmp_time(gt, &now) != 0) { |
225 | fprintf(stderr, "FAIL: test %i - successfully parsed as GENTIME " | 225 | fprintf(stderr, "FAIL: test %d - successfully parsed as GENTIME " |
226 | "string '%s'\n", test_no, att->str); | 226 | "string '%s'\n", test_no, att->str); |
227 | goto done; | 227 | goto done; |
228 | } | 228 | } |
229 | } | 229 | } |
230 | if (ASN1_UTCTIME_set_string(ut, att->str) != 0) { | 230 | if (ASN1_UTCTIME_set_string(ut, att->str) != 0) { |
231 | if (X509_cmp_time(ut, &now) != 0) { | 231 | if (X509_cmp_time(ut, &now) != 0) { |
232 | fprintf(stderr, "FAIL: test %i - successfully parsed as UTCTIME " | 232 | fprintf(stderr, "FAIL: test %d - successfully parsed as UTCTIME " |
233 | "string '%s'\n", test_no, att->str); | 233 | "string '%s'\n", test_no, att->str); |
234 | goto done; | 234 | goto done; |
235 | } | 235 | } |
236 | } | 236 | } |
237 | if (ASN1_TIME_set_string(t, att->str) != 0) { | 237 | if (ASN1_TIME_set_string(t, att->str) != 0) { |
238 | if (X509_cmp_time(t, &now) != 0) { | 238 | if (X509_cmp_time(t, &now) != 0) { |
239 | fprintf(stderr, "FAIL: test %i - successfully parsed as UTCTIME " | 239 | fprintf(stderr, "FAIL: test %d - successfully parsed as UTCTIME " |
240 | "string '%s'\n", test_no, att->str); | 240 | "string '%s'\n", test_no, att->str); |
241 | goto done; | 241 | goto done; |
242 | } | 242 | } |
@@ -264,7 +264,7 @@ rfc5280_gentime_test(int test_no, struct rfc5280_time_test *att) | |||
264 | goto done; | 264 | goto done; |
265 | 265 | ||
266 | if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 1) { | 266 | if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 1) { |
267 | fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", | 267 | fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", |
268 | test_no, att->str); | 268 | test_no, att->str); |
269 | goto done; | 269 | goto done; |
270 | } | 270 | } |
@@ -272,14 +272,14 @@ rfc5280_gentime_test(int test_no, struct rfc5280_time_test *att) | |||
272 | goto done; | 272 | goto done; |
273 | 273 | ||
274 | if ((i = X509_cmp_time(gt, &att->time)) != -1) { | 274 | if ((i = X509_cmp_time(gt, &att->time)) != -1) { |
275 | fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", | 275 | fprintf(stderr, "FAIL: test %d - X509_cmp_time failed - returned %d compared to %lld\n", |
276 | test_no, i, att->time); | 276 | test_no, i, att->time); |
277 | goto done; | 277 | goto done; |
278 | } | 278 | } |
279 | 279 | ||
280 | att->time--; | 280 | att->time--; |
281 | if ((i = X509_cmp_time(gt, &att->time)) != 1) { | 281 | if ((i = X509_cmp_time(gt, &att->time)) != 1) { |
282 | fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", | 282 | fprintf(stderr, "FAIL: test %d - X509_cmp_time failed - returned %d compared to %lld\n", |
283 | test_no, i, att->time); | 283 | test_no, i, att->time); |
284 | goto done; | 284 | goto done; |
285 | } | 285 | } |
@@ -288,7 +288,7 @@ rfc5280_gentime_test(int test_no, struct rfc5280_time_test *att) | |||
288 | ASN1_GENERALIZEDTIME_free(gt); | 288 | ASN1_GENERALIZEDTIME_free(gt); |
289 | 289 | ||
290 | if ((gt = ASN1_GENERALIZEDTIME_set(NULL, att->time)) == NULL) { | 290 | if ((gt = ASN1_GENERALIZEDTIME_set(NULL, att->time)) == NULL) { |
291 | fprintf(stderr, "FAIL: test %i - failed to set time %lli\n", | 291 | fprintf(stderr, "FAIL: test %d - failed to set time %lld\n", |
292 | test_no, (long long)att->time); | 292 | test_no, (long long)att->time); |
293 | goto done; | 293 | goto done; |
294 | } | 294 | } |
@@ -316,7 +316,7 @@ rfc5280_utctime_test(int test_no, struct rfc5280_time_test *att) | |||
316 | goto done; | 316 | goto done; |
317 | 317 | ||
318 | if (ASN1_UTCTIME_set_string(ut, att->str) != 1) { | 318 | if (ASN1_UTCTIME_set_string(ut, att->str) != 1) { |
319 | fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", | 319 | fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", |
320 | test_no, att->str); | 320 | test_no, att->str); |
321 | goto done; | 321 | goto done; |
322 | } | 322 | } |
@@ -324,14 +324,14 @@ rfc5280_utctime_test(int test_no, struct rfc5280_time_test *att) | |||
324 | goto done; | 324 | goto done; |
325 | 325 | ||
326 | if ((i = X509_cmp_time(ut, &att->time)) != -1) { | 326 | if ((i = X509_cmp_time(ut, &att->time)) != -1) { |
327 | fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", | 327 | fprintf(stderr, "FAIL: test %d - X509_cmp_time failed - returned %d compared to %lld\n", |
328 | test_no, i, att->time); | 328 | test_no, i, att->time); |
329 | goto done; | 329 | goto done; |
330 | } | 330 | } |
331 | 331 | ||
332 | att->time--; | 332 | att->time--; |
333 | if ((i = X509_cmp_time(ut, &att->time)) != 1) { | 333 | if ((i = X509_cmp_time(ut, &att->time)) != 1) { |
334 | fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", | 334 | fprintf(stderr, "FAIL: test %d - X509_cmp_time failed - returned %d compared to %lld\n", |
335 | test_no, i, att->time); | 335 | test_no, i, att->time); |
336 | goto done; | 336 | goto done; |
337 | } | 337 | } |
@@ -340,7 +340,7 @@ rfc5280_utctime_test(int test_no, struct rfc5280_time_test *att) | |||
340 | ASN1_UTCTIME_free(ut); | 340 | ASN1_UTCTIME_free(ut); |
341 | 341 | ||
342 | if ((ut = ASN1_UTCTIME_set(NULL, att->time)) == NULL) { | 342 | if ((ut = ASN1_UTCTIME_set(NULL, att->time)) == NULL) { |
343 | fprintf(stderr, "FAIL: test %i - failed to set time %lli\n", | 343 | fprintf(stderr, "FAIL: test %d - failed to set time %lld\n", |
344 | test_no, (long long)att->time); | 344 | test_no, (long long)att->time); |
345 | goto done; | 345 | goto done; |
346 | } | 346 | } |