RFC 5280 §4.2.1.6 says:
If the subject field contains an empty sequence, then the issuing CA MUST include a
subjectAltName extension that is marked as critical. When including the
subjectAltName extension in a certificate that has a non-empty subject
distinguished name, conforming CAs SHOULD mark the subjectAltName extension as
non-critical.
The first MUST requirement is tested by the x509-limbo rfc5280::san::noncritical-with-empty-subject testcase, and the second SHOULD is tested by webpki::san::san-critical-with-nonempty-subject, where the baseline requirements §7.1.2.7.12 elevates this to a MUST NOT for non-criticality:
If the subject field of the certificate is an empty SEQUENCE, this extension
MUST be marked critical, as specified in RFC 5280, Section 4.2.1.6. Otherwise,
this extension MUST NOT be marked critical.
Go crypto/x509 should enforce these requirements when verifying a leaf certificate so that the x509-limbo test cases produce the expected results.
The x509.CreateCertificate function already handles SAN criticality correctly when producing certificates.
Relates to #65085 https://go-review.googlesource.com/c/go/+/783980
RFC 5280 §4.2.1.6 says:
The first MUST requirement is tested by the
x509-limborfc5280::san::noncritical-with-empty-subject testcase, and the second SHOULD is tested by webpki::san::san-critical-with-nonempty-subject, where the baseline requirements §7.1.2.7.12 elevates this to a MUST NOT for non-criticality:Go crypto/x509 should enforce these requirements when verifying a leaf certificate so that the x509-limbo test cases produce the expected results.
The
x509.CreateCertificatefunction already handles SAN criticality correctly when producing certificates.Relates to #65085 https://go-review.googlesource.com/c/go/+/783980