Beryl::Certificates::NameConstraintCheck
Applies one CA's name constraints (RFC 5280 ยง4.2.1.10) to the names of a certificate below it.
- dNSName: a constraint
example.comcovers that name and every name ending in.example.com; an empty constraint covers every name. A constraint with a wildcard or a leading period is malformed. A presented wildcard*.baseis inside a permitted subtree only when all of it is (base within the subtree), and hits an excluded subtree when any name it could match would (base within the subtree, or the subtree within*.base), which closes CVE-2025-61727. - iPAddress: address and mask of 8 or 16 bytes, the mask contiguous.
- rfc822Name: a mailbox (
user@host, the local part compared exactly), a host (host, every mailbox there) or a domain (.domain, every mailbox at a host below it); an asterisk is a literal character. - uniformResourceIdentifier: the URI's host against
hostor.domain. - directoryName: the subject name, and directory names in the subject alternative names, must begin with the constraint's relative names.
Email addresses in the subject's emailAddress attributes count as rfc822Name. A constraint of a kind Beryl does not process (otherName, x400Address, ediPartyName, registeredID) refuses any certificate that carries a name of that kind, and is harmless otherwise.
Every comparison is counted against a budget shared by the whole validation, so a certificate with thousands of names under thousands of constraints is refused instead of taking quadratic time.
Constructors
Class methods
Instance methods
comparison_count
Source