Skip to content

crypto/x509: reject end-entity certs w/ name constraint ext. #79742

Description

@cpu

RFC 5280 §4.2.1.10 when spec'ing Name Constraints for the 5280 profie says:

The name constraints extension, which MUST be used only in a CA certificate

This is tested by the x509-limbo rfc5280::nc::not-allowed-in-ee-noncritical and rfc5280::nc::not-allowed-in-ee-critical testcases.

Go crypto/x509 should enforce these requirements when verifying a leaf certificate so that the x509-limbo test cases produce the expected results.

Separately, it may be worth considering whether the x509.CreateCertificate function should also be updated to error if the provided template includes name constraints, but is not a CA certificate.

Relates to #65085 https://go-review.googlesource.com/c/go/+/783980

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions