CVSROOT:        /cvs
Module name:    src
Changes by:     t...@cvs.openbsd.org    2025/07/10 13:22:48

Modified files:
        usr.sbin/rpki-client: cert.c extern.h x509.c 

Log message:
rpki-client: more detailed validation of the SPKI

Fully validate the AlgorithmIdentifier in the SPKI for both RSA and EC
keys. We have previously mostly ignored the parameters which in case of
an EC key tell us precisely what it is. Ensure the public key modulus
for RSA is 2048 bit and the exponent 65537. For !BGPsec certs only accept
P-256 when the experimental flag is given. Also take this opportunity to
copy the BRK into the cert.

This improves on checks currently done in x509_get_pubkey() and
valid_ca_pkey(). The former can go already. The latter will be
removed in the next step.

x509_get_pubkey() only warned about compressed point encoding. Make that
an error. First, RFC 8608 explicitly mandates that uncompressed encoding
be used. Second, even if it did not, compressed encoding is not free and
while P-256 is the easiest case p == 3 (mod 4) for BN_mod_sqrt(), this is
still work pushed to all RPs that is way more expensive than the 32 bytes
saved in the transfer.

ok job

Reply via email to