Index | Thread | Search

From:
Job Snijders <job@bsd.nl>
Subject:
Re: rpki-client: start reworking CMS signed object parsers
To:
Theo Buehler <tb@theobuehler.org>
Cc:
tech@openbsd.org
Date:
Tue, 16 Jun 2026 18:33:17 +0000

Download raw body.

Thread
On Tue, Jun 16, 2026 at 06:01:51PM +0200, Theo Buehler wrote:
> The diff below starts unifying various CMS signed object parsers in
> preparation for a lot more refactoring of this long-accumulated
> copy-paste mess.
> 
> The signed object is passed as a void * object to various handlers, so
> these handlers all have the same signature.
> 
> In this step, *_parse() is essentially split into allocation plus:
> 
> 1. *_cert_info(), which checks some basic things on the EE cert (usually
>    inheritance, presence or absence of RFC 3779 extensions). For MFTs
>    it also extracts some info and hangs that off mft.
> 
> 2. the already existing *_parse_econtent()
> 
> 3. *_validate() that does some validation steps, sets ->signtime and 
>    ->valid. In most signed object handlers the validate step can't
>    currently fail. This is one of the many warts we've accumulated
>    and is marked with an /* XXX */.
> 
> This is all straightforward and should not change anything.
> 
> The reason I put cert_info after parse_econtent is that the latter
> usually has some helpers and I found it easier to reason about this if
> the future struct members are somewhat close to each other.

OK job@