From 335482ab795f633f2f5ae6d881b8e9797efc6e9b Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 19 Mar 2024 05:04:13 +0000 Subject: [PATCH] Rename parent to issuer in struct auth Parent is confusing and issuer is the appropriate terminology. This is a mechanical diff. The only remaining uses of 'parent' in this code base now mean 'parent process'. discussed with beck and job ok job --- usr.sbin/rpki-client/cert.c | 6 +++--- usr.sbin/rpki-client/extern.h | 8 ++++---- usr.sbin/rpki-client/filemode.c | 10 +++++----- usr.sbin/rpki-client/ip.c | 4 ++-- usr.sbin/rpki-client/parser.c | 4 ++-- usr.sbin/rpki-client/validate.c | 10 +++++----- usr.sbin/rpki-client/x509.c | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/usr.sbin/rpki-client/cert.c b/usr.sbin/rpki-client/cert.c index 3c71238a81c..309ac438e50 100644 --- a/usr.sbin/rpki-client/cert.c +++ b/usr.sbin/rpki-client/cert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cert.c,v 1.127 2024/02/16 14:48:47 tb Exp $ */ +/* $OpenBSD: cert.c,v 1.128 2024/03/19 05:04:13 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * Copyright (c) 2021 Job Snijders @@ -1198,7 +1198,7 @@ auth_find(struct auth_tree *auths, const char *aki) } struct auth * -auth_insert(struct auth_tree *auths, struct cert *cert, struct auth *parent) +auth_insert(struct auth_tree *auths, struct cert *cert, struct auth *issuer) { struct auth *na; @@ -1206,7 +1206,7 @@ auth_insert(struct auth_tree *auths, struct cert *cert, struct auth *parent) if (na == NULL) err(1, NULL); - na->parent = parent; + na->issuer = issuer; na->cert = cert; na->any_inherits = x509_any_inherits(cert->x509); diff --git a/usr.sbin/rpki-client/extern.h b/usr.sbin/rpki-client/extern.h index cca436a1c9d..142c26e5260 100644 --- a/usr.sbin/rpki-client/extern.h +++ b/usr.sbin/rpki-client/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.211 2024/03/17 01:44:59 tb Exp $ */ +/* $OpenBSD: extern.h,v 1.212 2024/03/19 05:04:13 tb Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -26,7 +26,7 @@ enum cert_as_type { CERT_AS_ID, /* single identifier */ - CERT_AS_INHERIT, /* inherit from parent */ + CERT_AS_INHERIT, /* inherit from issuer */ CERT_AS_RANGE, /* range of identifiers */ }; @@ -376,7 +376,7 @@ struct gbr { * A single ASPA record */ struct aspa { - int valid; /* contained in parent auth */ + int valid; /* contained in issuer auth */ int talid; /* TAL the ASPA is chained up to */ char *aia; /* AIA */ char *aki; /* AKI */ @@ -491,7 +491,7 @@ RB_HEAD(crl_tree, crl); struct auth { RB_ENTRY(auth) entry; struct cert *cert; /* owner information */ - struct auth *parent; /* pointer to parent or NULL for TA cert */ + struct auth *issuer; /* pointer to issuer or NULL for TA cert */ int any_inherits; }; /* diff --git a/usr.sbin/rpki-client/filemode.c b/usr.sbin/rpki-client/filemode.c index 5daf03b72f3..90f20bf7473 100644 --- a/usr.sbin/rpki-client/filemode.c +++ b/usr.sbin/rpki-client/filemode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filemode.c,v 1.38 2024/02/22 12:49:42 job Exp $ */ +/* $OpenBSD: filemode.c,v 1.39 2024/03/19 05:04:13 tb Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -268,13 +268,13 @@ print_signature_path(const char *crl, const char *aia, const struct auth *a) if (aia != NULL) printf(" %s\n", aia); - for (; a != NULL; a = a->parent) { + for (; a != NULL; a = a->issuer) { if (a->cert->crl != NULL) printf(" %s\n", a->cert->crl); - if (a->parent != NULL && a->parent->cert != NULL && - a->parent->cert->mft != NULL) + if (a->issuer != NULL && a->issuer->cert != NULL && + a->issuer->cert->mft != NULL) printf(" %s\n", - a->parent->cert->mft); + a->issuer->cert->mft); if (a->cert->aia != NULL) printf(" %s\n", a->cert->aia); } diff --git a/usr.sbin/rpki-client/ip.c b/usr.sbin/rpki-client/ip.c index 8cd936a753f..3e021f08aa6 100644 --- a/usr.sbin/rpki-client/ip.c +++ b/usr.sbin/rpki-client/ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip.c,v 1.32 2023/12/27 07:15:55 tb Exp $ */ +/* $OpenBSD: ip.c,v 1.33 2024/03/19 05:04:13 tb Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -72,7 +72,7 @@ ip_addr_afi_parse(const char *fn, const ASN1_OCTET_STRING *p, enum afi *afi) * specified in the "ips" array. * This means that the IP prefix must be strictly within the ranges or * singletons given in the array. - * Return 0 if we're inheriting from the parent, >0 if we're covered, + * Return 0 if we're inheriting from the issuer, >0 if we're covered, * or <0 if we're not covered. */ int diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index 6bb52a6a7f7..a3f4e70fd44 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.130 2024/03/01 08:10:09 tb Exp $ */ +/* $OpenBSD: parser.c,v 1.131 2024/03/19 05:04:13 tb Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -670,7 +670,7 @@ proc_parser_tak(char *file, const unsigned char *der, size_t len, } /* TAK EE must be signed by self-signed CA */ - if (a->parent != NULL) + if (a->issuer != NULL) goto out; tak->talid = a->cert->talid; diff --git a/usr.sbin/rpki-client/validate.c b/usr.sbin/rpki-client/validate.c index 5d4656cb556..73cf42eb066 100644 --- a/usr.sbin/rpki-client/validate.c +++ b/usr.sbin/rpki-client/validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: validate.c,v 1.72 2024/02/22 12:49:42 job Exp $ */ +/* $OpenBSD: validate.c,v 1.73 2024/03/19 05:04:13 tb Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -50,7 +50,7 @@ valid_as(struct auth *a, uint32_t min, uint32_t max) return 0; /* If it inherits, walk up the chain. */ - return valid_as(a->parent, min, max); + return valid_as(a->issuer, min, max); } /* @@ -76,13 +76,13 @@ valid_ip(struct auth *a, enum afi afi, return 0; /* If it inherits, walk up the chain. */ - return valid_ip(a->parent, afi, min, max); + return valid_ip(a->issuer, afi, min, max); } /* * Make sure the AKI is the same as the AKI listed on the Manifest, * and that the SKI doesn't already exist. - * Return the parent by its AKI, or NULL on failure. + * Return the issuer by its AKI, or NULL on failure. */ struct auth * valid_ski_aki(const char *fn, struct auth_tree *auths, @@ -357,7 +357,7 @@ build_chain(const struct auth *a, STACK_OF(X509) **intermediates, err(1, "sk_X509_new_null"); if ((*root = sk_X509_new_null()) == NULL) err(1, "sk_X509_new_null"); - for (; a != NULL; a = a->parent) { + for (; a != NULL; a = a->issuer) { assert(a->cert->x509 != NULL); if (!a->any_inherits) { if (!sk_X509_push(*root, a->cert->x509)) diff --git a/usr.sbin/rpki-client/x509.c b/usr.sbin/rpki-client/x509.c index 5646eb7154d..86ba7689a47 100644 --- a/usr.sbin/rpki-client/x509.c +++ b/usr.sbin/rpki-client/x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.c,v 1.81 2024/02/22 12:49:42 job Exp $ */ +/* $OpenBSD: x509.c,v 1.82 2024/03/19 05:04:13 tb Exp $ */ /* * Copyright (c) 2022 Theo Buehler * Copyright (c) 2021 Claudio Jeker @@ -1046,7 +1046,7 @@ x509_find_expires(time_t notafter, struct auth *a, struct crl_tree *crlt) expires = notafter; - for (; a != NULL; a = a->parent) { + for (; a != NULL; a = a->issuer) { if (expires > a->cert->notafter) expires = a->cert->notafter; crl = crl_get(crlt, a); -- 2.20.1