-/* $OpenBSD: constraints.c,v 1.13 2022/11/11 12:02:34 beck Exp $ */
+/* $OpenBSD: constraints.c,v 1.14 2022/11/23 23:06:16 kn Exp $ */
/*
* Copyright (c) 2020 Bob Beck <beck@openbsd.org>
*
{
int i, failure = 0;
char *nulhost = "www.openbsd.org\0";
+ CBS cbs;
for (i = 0; invalid_hostnames[i] != NULL; i++) {
- CBS cbs;
CBS_init(&cbs, invalid_hostnames[i],
strlen(invalid_hostnames[i]));
if (x509_constraints_valid_host(&cbs)) {
goto done;
}
}
- CBS cbs;
CBS_init(&cbs, nulhost, strlen(nulhost) + 1);
if (x509_constraints_valid_host(&cbs)) {
FAIL("hostname with NUL byte accepted\n");