From: job Date: Mon, 13 Mar 2023 09:24:37 +0000 (+0000) Subject: Rename some data fields to closer match their provenance X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4dbb22b8de65b6062a3c2fee2edf1744cb4b6c08;p=openbsd Rename some data fields to closer match their provenance OK tb@ --- diff --git a/usr.sbin/rpki-client/extern.h b/usr.sbin/rpki-client/extern.h index 4e6b956fd6f..74119a55112 100644 --- a/usr.sbin/rpki-client/extern.h +++ b/usr.sbin/rpki-client/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.173 2023/03/12 11:54:56 job Exp $ */ +/* $OpenBSD: extern.h,v 1.174 2023/03/13 09:24:37 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -211,8 +211,8 @@ struct mft { char *crl; /* CRL file name */ unsigned char crlhash[SHA256_DIGEST_LENGTH]; time_t signtime; /* CMS signing-time attribute */ - time_t valid_since; - time_t valid_until; + time_t thisupdate; /* from the eContent */ + time_t nextupdate; /* from the eContent */ size_t filesz; /* number of filenames */ unsigned int repoid; int stale; /* if a stale manifest */ diff --git a/usr.sbin/rpki-client/mft.c b/usr.sbin/rpki-client/mft.c index a8848ed4856..eb7db16c801 100644 --- a/usr.sbin/rpki-client/mft.c +++ b/usr.sbin/rpki-client/mft.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mft.c,v 1.86 2023/03/12 11:54:56 job Exp $ */ +/* $OpenBSD: mft.c,v 1.87 2023/03/13 09:24:37 job Exp $ */ /* * Copyright (c) 2022 Theo Buehler * Copyright (c) 2019 Kristaps Dzonsons @@ -130,8 +130,8 @@ mft_parse_time(const ASN1_GENERALIZEDTIME *from, return 0; } - if ((p->res->valid_since = timegm(&tm_from)) == -1 || - (p->res->valid_until = timegm(&tm_until)) == -1) + if ((p->res->thisupdate = timegm(&tm_from)) == -1 || + (p->res->nextupdate = timegm(&tm_until)) == -1) errx(1, "%s: timegm failed", p->fn); return 1; diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index 66fab3d4b02..3dd64b851ba 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.88 2023/03/12 11:54:56 job Exp $ */ +/* $OpenBSD: parser.c,v 1.89 2023/03/13 09:24:37 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -313,15 +313,15 @@ proc_parser_mft_post(char *file, struct mft *mft, const char *path, } /* check that now is not before from */ - if (now < mft->valid_since) { + if (now < mft->thisupdate) { warnx("%s: mft not yet valid %s", file, - time2str(mft->valid_since)); + time2str(mft->thisupdate)); mft->stale = 1; } /* check that now is not after until */ - if (now > mft->valid_until) { + if (now > mft->nextupdate) { warnx("%s: mft expired on %s", file, - time2str(mft->valid_until)); + time2str(mft->nextupdate)); mft->stale = 1; } diff --git a/usr.sbin/rpki-client/print.c b/usr.sbin/rpki-client/print.c index 78aa44d9313..209ad361439 100644 --- a/usr.sbin/rpki-client/print.c +++ b/usr.sbin/rpki-client/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.31 2023/03/10 12:44:56 job Exp $ */ +/* $OpenBSD: print.c,v 1.32 2023/03/13 09:24:37 job Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -202,14 +202,14 @@ cert_print(const struct cert *p) if (p->pubkey != NULL) { printf("BGPsec ECDSA public key: %s\n", p->pubkey); - printf("Router key valid since: %s\n", + printf("Router key not before: %s\n", time2str(p->notbefore)); - printf("Router key valid until: %s\n", + printf("Router key not after: %s\n", time2str(p->notafter)); } else { - printf("Certificate valid since: %s\n", + printf("Certificate not before: %s\n", time2str(p->notbefore)); - printf("Certificate valid until: %s\n", + printf("Certificate not after: %s\n", time2str(p->notafter)); } printf("Subordinate resources: "); @@ -340,9 +340,9 @@ crl_print(const struct crl *p) printf("\t\"valid_until\": %lld,\n", (long long)p->nextupdate); printf("\t\"revoked_certs\": [\n"); } else { - printf("CRL valid since: %s\n", + printf("CRL last update: %s\n", time2str(p->lastupdate)); - printf("CRL valid until: %s\n", + printf("CRL next update: %s\n", time2str(p->nextupdate)); printf("Revoked Certificates:\n"); } @@ -390,8 +390,8 @@ mft_print(const X509 *x, const struct mft *p) if (p->signtime != 0) printf("\t\"signing_time\": %lld,\n", (long long)p->signtime); - printf("\t\"valid_since\": %lld,\n", (long long)p->valid_since); - printf("\t\"valid_until\": %lld,\n", (long long)p->valid_until); + printf("\t\"valid_since\": %lld,\n", (long long)p->thisupdate); + printf("\t\"valid_until\": %lld,\n", (long long)p->nextupdate); } else { printf("Subject key identifier: %s\n", pretty_key_id(p->ski)); printf("Authority key identifier: %s\n", pretty_key_id(p->aki)); @@ -402,8 +402,8 @@ mft_print(const X509 *x, const struct mft *p) if (p->signtime != 0) printf("Signing time: %s\n", time2str(p->signtime)); - printf("Manifest valid since: %s\n", time2str(p->valid_since)); - printf("Manifest valid until: %s\n", time2str(p->valid_until)); + printf("Manifest this update: %s\n", time2str(p->thisupdate)); + printf("Manifest next update: %s\n", time2str(p->nextupdate)); printf("Files and hashes: "); } @@ -462,9 +462,9 @@ roa_print(const X509 *x, const struct roa *p) if (p->signtime != 0) printf("Signing time: %s\n", time2str(p->signtime)); - printf("ROA valid since: %s\n", + printf("ROA not before: %s\n", time2str(p->notbefore)); - printf("ROA valid until: %s\n", time2str(p->notafter)); + printf("ROA not after: %s\n", time2str(p->notafter)); printf("asID: %u\n", p->asid); printf("IP address blocks: "); } @@ -532,9 +532,9 @@ gbr_print(const X509 *x, const struct gbr *p) if (p->signtime != 0) printf("Signing time: %s\n", time2str(p->signtime)); - printf("GBR valid since: %s\n", + printf("GBR not before: %s\n", time2str(p->notbefore)); - printf("GBR valid until: %s\n", time2str(p->notafter)); + printf("GBR not after: %s\n", time2str(p->notafter)); printf("vcard:\n%s", p->vcard); } } @@ -566,9 +566,9 @@ rsc_print(const X509 *x, const struct rsc *p) if (p->signtime != 0) printf("Signing time: %s\n", time2str(p->signtime)); - printf("RSC valid since: %s\n", + printf("RSC not before: %s\n", time2str(p->notbefore)); - printf("RSC valid until: %s\n", time2str(p->notafter)); + printf("RSC not after: %s\n", time2str(p->notafter)); printf("Signed with resources: "); } @@ -715,9 +715,9 @@ aspa_print(const X509 *x, const struct aspa *p) if (p->signtime != 0) printf("Signing time: %s\n", time2str(p->signtime)); - printf("ASPA valid since: %s\n", + printf("ASPA not before: %s\n", time2str(p->notbefore)); - printf("ASPA valid until: %s\n", time2str(p->notafter)); + printf("ASPA not after: %s\n", time2str(p->notafter)); printf("Customer AS: %u\n", p->custasid); printf("Provider Set: "); for (i = 0; i < p->providersz; i++) { @@ -816,9 +816,9 @@ tak_print(const X509 *x, const struct tak *p) if (p->signtime != 0) printf("Signing time: %s\n", time2str(p->signtime)); - printf("TAK valid since: %s\n", + printf("TAK not before: %s\n", time2str(p->notbefore)); - printf("TAK valid until: %s\n", time2str(p->notafter)); + printf("TAK not after: %s\n", time2str(p->notafter)); } takey_print("current", p->current); @@ -865,9 +865,9 @@ geofeed_print(const X509 *x, const struct geofeed *p) if (p->signtime != 0) printf("Signing time: %s\n", time2str(p->signtime)); - printf("Geofeed valid since: %s\n", + printf("Geofeed not before: %s\n", time2str(p->notbefore)); - printf("Geofeed valid until: %s\n", time2str(p->notafter)); + printf("Geofeed not after: %s\n", time2str(p->notafter)); printf("Geofeed CSV records:\n"); }