-/* $OpenBSD: x509_addr.c,v 1.66 2022/01/05 17:41:41 tb Exp $ */
+/* $OpenBSD: x509_addr.c,v 1.67 2022/01/05 17:43:04 tb Exp $ */
/*
* Contributed to the OpenSSL Project by the American Registry for
* Internet Numbers ("ARIN").
IPAddrBlocks *child = NULL, *parent = NULL;
IPAddressFamily *fc, *fp;
IPAddressOrRanges *aorc, *aorp;
- X509 *x = NULL;
+ X509 *cert = NULL;
int depth = -1;
int i, k;
unsigned int length;
*/
if (ext == NULL) {
depth = 0;
- x = sk_X509_value(chain, depth);
- if ((ext = x->rfc3779_addr) == NULL)
+ cert = sk_X509_value(chain, depth);
+ if ((ext = cert->rfc3779_addr) == NULL)
goto done;
}
if (!X509v3_addr_is_canonical(ext)) {
- if ((ret = verify_error(ctx, x,
+ if ((ret = verify_error(ctx, cert,
X509_V_ERR_INVALID_EXTENSION, depth)) == 0)
goto done;
}
* doesn't list.
*/
for (depth++; depth < sk_X509_num(chain); depth++) {
- x = sk_X509_value(chain, depth);
+ cert = sk_X509_value(chain, depth);
- if ((parent = x->rfc3779_addr) == NULL) {
+ if ((parent = cert->rfc3779_addr) == NULL) {
for (i = 0; i < sk_IPAddressFamily_num(child); i++) {
fc = sk_IPAddressFamily_value(child, i);
if (IPAddressFamily_inheritance(fc) != NULL)
continue;
- if ((ret = verify_error(ctx, x,
+ if ((ret = verify_error(ctx, cert,
X509_V_ERR_UNNESTED_RESOURCE, depth)) == 0)
goto done;
break;
}
if (!X509v3_addr_is_canonical(parent)) {
- if ((ret = verify_error(ctx, x,
+ if ((ret = verify_error(ctx, cert,
X509_V_ERR_INVALID_EXTENSION, depth)) == 0)
goto done;
}
continue;
/* Otherwise the child isn't covered. */
- if ((ret = verify_error(ctx, x,
+ if ((ret = verify_error(ctx, cert,
X509_V_ERR_UNNESTED_RESOURCE, depth)) == 0)
goto done;
break;
continue;
}
- if ((ret = verify_error(ctx, x,
+ if ((ret = verify_error(ctx, cert,
X509_V_ERR_UNNESTED_RESOURCE, depth)) == 0)
goto done;
}
/*
* Trust anchor can't inherit.
*/
- if ((parent = x->rfc3779_addr) != NULL) {
+ if ((parent = cert->rfc3779_addr) != NULL) {
for (i = 0; i < sk_IPAddressFamily_num(parent); i++) {
fp = sk_IPAddressFamily_value(parent, i);
if (sk_IPAddressFamily_find(child, fp) < 0)
continue;
- if ((ret = verify_error(ctx, x,
+ if ((ret = verify_error(ctx, cert,
X509_V_ERR_UNNESTED_RESOURCE, depth)) == 0)
goto done;
}