On Sat, Sep 03, 2022 at 01:18:13PM +0200, Claudio Jeker wrote:
> This diff adds the parentid to struct cert. The parentid is the id of the
> repository the cert lives in. This information will be used to track the
> parent repository in the repositories list/tree.
>
> The naming is confusing and I'm happy for better suggestions.
I wouldn't mind being more explicit and call it parentrepoid.
ok
> --
> :wq Claudio
>
> Index: cert.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/cert.c,v
> retrieving revision 1.85
> diff -u -p -r1.85 cert.c
> --- cert.c 19 Aug 2022 12:45:53 -0000 1.85
> +++ cert.c 3 Sep 2022 11:03:46 -0000
> @@ -898,6 +898,7 @@ cert_buffer(struct ibuf *b, const struct
> io_simple_buffer(b, &p->expires, sizeof(p->expires));
> io_simple_buffer(b, &p->purpose, sizeof(p->purpose));
> io_simple_buffer(b, &p->talid, sizeof(p->talid));
> + io_simple_buffer(b, &p->parentid, sizeof(p->parentid));
> io_simple_buffer(b, &p->ipsz, sizeof(p->ipsz));
> io_simple_buffer(b, &p->asz, sizeof(p->asz));
>
> @@ -930,6 +931,7 @@ cert_read(struct ibuf *b)
> io_read_buf(b, &p->expires, sizeof(p->expires));
> io_read_buf(b, &p->purpose, sizeof(p->purpose));
> io_read_buf(b, &p->talid, sizeof(p->talid));
> + io_read_buf(b, &p->parentid, sizeof(p->parentid));
> io_read_buf(b, &p->ipsz, sizeof(p->ipsz));
> io_read_buf(b, &p->asz, sizeof(p->asz));
>
> Index: extern.h
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/extern.h,v
> retrieving revision 1.153
> diff -u -p -r1.153 extern.h
> --- extern.h 2 Sep 2022 19:10:36 -0000 1.153
> +++ extern.h 3 Sep 2022 11:03:46 -0000
> @@ -137,6 +137,7 @@ struct cert {
> struct cert_as *as; /* list of AS numbers and ranges */
> size_t asz; /* length of "asz" */
> int talid; /* cert is covered by which TAL */
> + unsigned int parentid; /* parent repository of this cert */
> char *repo; /* CA repository (rsync:// uri) */
> char *mft; /* manifest (rsync:// uri) */
> char *notify; /* RRDP notify (https:// uri) */
> Index: parser.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/parser.c,v
> retrieving revision 1.75
> diff -u -p -r1.75 parser.c
> --- parser.c 30 Aug 2022 18:56:49 -0000 1.75
> +++ parser.c 3 Sep 2022 11:03:46 -0000
> @@ -596,8 +596,10 @@ parse_entity(struct entityq *q, struct m
> cert = proc_parser_cert(file, f, flen);
> c = (cert != NULL);
> io_simple_buffer(b, &c, sizeof(int));
> - if (cert != NULL)
> + if (cert != NULL) {
> + cert->parentid = entp->repoid;
> cert_buffer(b, cert);
> + }
> /*
> * The parsed certificate data "cert" is now
> * managed in the "auths" table, so don't free
>