CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2026/11/24 14:48:10

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

Log message:
rpki-client: add further validation for Name

RFC 6487, sections 4.4, 4.5, and 5 require the CommonName attribute and
allow the serialNumber attribute in cert issuer, subject and CRL issuer,
respectively. The commonName must be a PrintableString per section 4.4
(for BRKs too, per eid8653). Further, X.520 specifies a PrintableString
for serialNumber and RFC 5280 specifies a SIZE (1..64) constraint for
both attributes.

All serialNumber in the wild attributes are PrintableString(SIZE(1..64)),
but there are ~110 CAs (almost all of them part of rebistro.br) that use
a very old version of Krill (older than 0.9.3rc2) to ship ~900 products
were rpki-rs added the full hex encoded SPKI DER into the CommonName
instead of hashing it to become a key identifier (as recomended for the
subject name in RFC 6487, section 8, 1)). This was fixed in rpki-rs#165
and krill#704 in 2021.

Enforce encoding of serialNumber as a PrintableString() and enforce the
length constraints, but carve out an exception allowing a CommonName of
length 540 octets. Warn on -vv or != 540.

We will attempt to resolve this encoding nit and plan on dropping the
540 workaround in a future release.

ok claudio job

Reply via email to