summaryrefslogtreecommitdiff
path: root/src/regress
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress')
-rw-r--r--src/regress/lib/libcrypto/x509/constraints.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/regress/lib/libcrypto/x509/constraints.c b/src/regress/lib/libcrypto/x509/constraints.c
index b552f30989..d4867a362c 100644
--- a/src/regress/lib/libcrypto/x509/constraints.c
+++ b/src/regress/lib/libcrypto/x509/constraints.c
@@ -397,6 +397,10 @@ test_constraints1(void)
397 "", 397 "",
398 NULL, 398 NULL,
399 }; 399 };
400 unsigned char *noauthority[] = {
401 "urn:open62541.server.application",
402 NULL,
403 };
400 for (i = 0; constraints[i] != NULL; i++) { 404 for (i = 0; constraints[i] != NULL; i++) {
401 char *constraint = constraints[i]; 405 char *constraint = constraints[i];
402 size_t clen = strlen(constraints[i]); 406 size_t clen = strlen(constraints[i]);
@@ -442,6 +446,28 @@ test_constraints1(void)
442 goto done; 446 goto done;
443 } 447 }
444 } 448 }
449 for (j = 0; noauthority[j] != NULL; j++) {
450 error = 0;
451 char *hostpart = NULL;
452 if (!x509_constraints_uri_host(noauthority[j],
453 strlen(noauthority[j]), &hostpart)) {
454 FAIL("name '%s' should parse as a URI",
455 noauthority[j]);
456 failure = 1;
457 free(hostpart);
458 goto done;
459 }
460 free(hostpart);
461
462 if (x509_constraints_uri(noauthority[j],
463 strlen(noauthority[j]), constraint, clen, &error)) {
464 FAIL("constraint '%s' should not have matched URI"
465 " '%s' (error %d)\n",
466 constraint, failinguri[j], error);
467 failure = 1;
468 goto done;
469 }
470 }
445 } 471 }
446 c = ".openbsd.org"; 472 c = ".openbsd.org";
447 cl = strlen(".openbsd.org"); 473 cl = strlen(".openbsd.org");