Skip to content

Commit ed2996b

Browse files
rolandshoemakerFiloSottile
authored andcommitted
crypto/x509: document support for leading periods in DNS constraints
This change adds a comment to the Verify documentation that indicates that you can use URI and email style name constraints with a leading period for DNS names (and explains what they do). This behavior is not standards compliant, but matches the community application of RFC 5280, so it makes sense to document it. Fixes #37535 Change-Id: Ibd6f039e4fa46d40ad7ae1ab48eab86f13cf8eff Reviewed-on: https://go-review.googlesource.com/c/go/+/233525 Reviewed-by: Ryan Sleevi <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]>
1 parent e05695e commit ed2996b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/crypto/x509/verify.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,12 @@ func (c *Certificate) isValid(certType int, currentChain []*Certificate, opts *V
744744
// the name being validated. Note that DirectoryName constraints are not
745745
// supported.
746746
//
747+
// Name constraint validation follows the rules from RFC 5280, with the
748+
// addition that DNS name constraints may use the leading period format
749+
// defined for emails and URIs. When a constraint has a leading period
750+
// it indicates that at least one additional label must be prepended to
751+
// the constrained name to be considered valid.
752+
//
747753
// Extended Key Usage values are enforced down a chain, so an intermediate or
748754
// root that enumerates EKUs prevents a leaf from asserting an EKU not in that
749755
// list.

0 commit comments

Comments
 (0)