and the filename is only used in tracewarn which is not that helpful.
OK tb@
-/* $OpenBSD: extern.h,v 1.86 2021/10/29 09:27:36 claudio Exp $ */
+/* $OpenBSD: extern.h,v 1.87 2021/11/01 09:12:18 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
RB_ENTRY(auth) entry;
struct cert *cert; /* owner information */
struct auth *parent; /* pointer to parent or NULL for TA cert */
- char *tal; /* basename of TAL for this cert */
- char *fn; /* FIXME: debugging */
};
/*
* Tree of auth sorted by ski
-/* $OpenBSD: parser.c,v 1.21 2021/10/28 09:02:19 beck Exp $ */
+/* $OpenBSD: parser.c,v 1.22 2021/11/01 09:12:18 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*/
cert->valid = 1;
+ if ((cert->tal = strdup(a->cert->tal)) == NULL)
+ err(1, NULL);
na = malloc(sizeof(*na));
if (na == NULL)
err(1, NULL);
-
- cert->tal = strdup(a->tal);
- if (cert->tal == NULL)
- err(1, NULL);
-
na->parent = a;
na->cert = cert;
- na->tal = a->tal;
- na->fn = strdup(entp->file);
- if (na->fn == NULL)
- err(1, NULL);
if (RB_INSERT(auth_tree, &auths, na) != NULL)
err(1, "auth tree corrupted");
struct cert *cert;
X509 *x509;
struct auth *na;
- char *tal;
assert(entp->has_data);
*/
cert->valid = 1;
+ if ((cert->tal = strdup(entp->descr)) == NULL)
+ err(1, NULL);
na = malloc(sizeof(*na));
if (na == NULL)
err(1, NULL);
-
- if ((tal = strdup(entp->descr)) == NULL)
- err(1, NULL);
-
na->parent = NULL;
na->cert = cert;
- na->tal = tal;
- na->fn = strdup(entp->file);
- if (na->fn == NULL)
- err(1, NULL);
if (RB_INSERT(auth_tree, &auths, na) != NULL)
err(1, "auth tree corrupted");
-/* $OpenBSD: validate.c,v 1.20 2021/10/29 09:27:36 claudio Exp $ */
+/* $OpenBSD: validate.c,v 1.21 2021/11/01 09:12:18 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
#include "extern.h"
-static void
-tracewarn(const struct auth *a)
-{
-
- for (; a != NULL; a = a->parent)
- warnx(" ...inheriting from: %s", a->fn);
-}
-
/*
* Walk up the chain of certificates trying to match our AS number to
* one of the allocations in that chain.
continue;
warnx("%s: RFC 6487: uncovered AS: "
"%u--%u", fn, min, max);
- tracewarn(a);
return 0;
}
"(inherit)", fn);
break;
}
- tracewarn(a);
return 0;
}
if (a == NULL)
return 0;
- if ((roa->tal = strdup(a->tal)) == NULL)
+ if ((roa->tal = strdup(a->cert->tal)) == NULL)
err(1, NULL);
for (i = 0; i < roa->ipsz; i++) {
roa->ips[i].afi, buf, sizeof(buf));
warnx("%s: RFC 6482: uncovered IP: "
"%s", fn, buf);
- tracewarn(a);
return 0;
}