[go] crypto/x509: add directory name constraints (WIP)

49 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Jun 17, 2020, 1:56:31 AM6/17/20
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

crypto/x509: add directory name constraints (WIP)

It is still missing tests.

Fixes #15196

This is my first day using golang. So, this PR might have newbie codes that might require improvements.

I'm reparsing Subject in order to compare it. However, Certificate class could keep a RDNSequence and save some cycles.

It might be a better way to do the dirname compassion (without using three nested for).

Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
GitHub-Last-Rev: 4f8fbd34448d9208a05279206e406d59b53a5896
GitHub-Pull-Request: golang/go#39639
---
M src/crypto/x509/verify.go
M src/crypto/x509/x509.go
2 files changed, 82 insertions(+), 19 deletions(-)

diff --git a/src/crypto/x509/verify.go b/src/crypto/x509/verify.go
index be11e73..57ed57a 100644
--- a/src/crypto/x509/verify.go
+++ b/src/crypto/x509/verify.go
@@ -6,6 +6,8 @@

import (
"bytes"
+ "crypto/x509/pkix"
+ "encoding/asn1"
"errors"
"fmt"
"net"
@@ -516,6 +518,34 @@
return true, nil
}

+func matchDirNameConstraint(dirname pkix.RDNSequence, constraint *pkix.RDNSequence) (bool, error) {
+
+ if len(*constraint) > len(dirname) {
+ return false, nil
+ }
+ for i, rdn := range *constraint {
+ if len(rdn) > len(dirname[i]) {
+ return false, nil
+ }
+ for j, const_tv := range rdn {
+ dirname_tv := dirname[i][j]
+ if len(const_tv.Type) != len(dirname_tv.Type) {
+ return false, nil
+ }
+ for k, _ := range const_tv.Type {
+ if const_tv.Type[k] != dirname_tv.Type[k] {
+ return false, nil
+ }
+ }
+ if const_tv.Value != dirname_tv.Value {
+ return false, nil
+ }
+ }
+ }
+
+ return true, nil
+}
+
// checkNameConstraints checks that c permits a child certificate to claim the
// given name, of type nameType. The argument parsedName contains the parsed
// form of name, suitable for passing to the match function. The total number
@@ -623,6 +653,24 @@
}

checkNameConstraints := (certType == intermediateCertificate || certType == rootCertificate) && c.hasNameConstraints()
+ if checkNameConstraints {
+ var leafSubject pkix.RDNSequence
+
+ // leaf.Subject.ToRDNSequence cannot be used as it ignores unknown RDN
+ if rest, err := asn1.Unmarshal(leaf.RawSubject, &leafSubject); err != nil {
+ return err
+ } else if len(rest) != 0 {
+ return errors.New("x509: trailing data after X.509 subject")
+ }
+
+ if err := c.checkNameConstraints(&comparisonCount, maxConstraintComparisons, "directory Name", leaf.Subject.String(), leafSubject,
+ func(parsedName, constraint interface{}) (bool, error) {
+ return matchDirNameConstraint(parsedName.(pkix.RDNSequence), constraint.(*pkix.RDNSequence))
+ }, c.PermittedDirNames, c.ExcludedDirNames); err != nil {
+ return err
+ }
+ }
+
if checkNameConstraints && leaf.commonNameAsHostname() {
// This is the deprecated, legacy case of depending on the commonName as
// a hostname. We don't enforce name constraints against the CN, but
diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go
index 338b488..cdfef07 100644
--- a/src/crypto/x509/x509.go
+++ b/src/crypto/x509/x509.go
@@ -748,6 +748,8 @@

// Name constraints
PermittedDNSDomainsCritical bool // if true then the name constraints are marked critical.
+ PermittedDirNames []*pkix.RDNSequence
+ ExcludedDirNames []*pkix.RDNSequence
PermittedDNSDomains []string
ExcludedDNSDomains []string
PermittedIPRanges []*net.IPNet
@@ -1211,27 +1213,28 @@
return false, errors.New("x509: empty name constraints extension")
}

- getValues := func(subtrees cryptobyte.String) (dnsNames []string, ips []*net.IPNet, emails, uriDomains []string, err error) {
+ getValues := func(subtrees cryptobyte.String) (dirNames []*pkix.RDNSequence, dnsNames []string, ips []*net.IPNet, emails, uriDomains []string, err error) {
for !subtrees.Empty() {
var seq, value cryptobyte.String
var tag cryptobyte_asn1.Tag
if !subtrees.ReadASN1(&seq, cryptobyte_asn1.SEQUENCE) ||
!seq.ReadAnyASN1(&value, &tag) {
- return nil, nil, nil, nil, fmt.Errorf("x509: invalid NameConstraints extension")
+ return nil, nil, nil, nil, nil, fmt.Errorf("x509: invalid NameConstraints extension")
}

var (
- dnsTag = cryptobyte_asn1.Tag(2).ContextSpecific()
- emailTag = cryptobyte_asn1.Tag(1).ContextSpecific()
- ipTag = cryptobyte_asn1.Tag(7).ContextSpecific()
- uriTag = cryptobyte_asn1.Tag(6).ContextSpecific()
+ dirNameTag = cryptobyte_asn1.Tag(4).ContextSpecific().Constructed()
+ dnsTag = cryptobyte_asn1.Tag(2).ContextSpecific()
+ emailTag = cryptobyte_asn1.Tag(1).ContextSpecific()
+ ipTag = cryptobyte_asn1.Tag(7).ContextSpecific()
+ uriTag = cryptobyte_asn1.Tag(6).ContextSpecific()
)

switch tag {
case dnsTag:
domain := string(value)
if err := isIA5String(domain); err != nil {
- return nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error())
+ return nil, nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error())
}

trimmedDomain := domain
@@ -1243,10 +1246,22 @@
trimmedDomain = trimmedDomain[1:]
}
if _, ok := domainToReverseLabels(trimmedDomain); !ok {
- return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse dnsName constraint %q", domain)
+ return nil, nil, nil, nil, nil, fmt.Errorf("x509: failed to parse dnsName constraint %q", domain)
}
dnsNames = append(dnsNames, domain)

+ case dirNameTag:
+
+ var dirName pkix.RDNSequence
+
+ if rest, err := asn1.Unmarshal(value, &dirName); err != nil {
+ return nil, nil, nil, nil, nil, err
+ } else if len(rest) != 0 {
+ return nil, nil, nil, nil, nil, errors.New("x509: trailing data after dirname constraint")
+ }
+
+ dirNames = append(dirNames, &dirName)
+
case ipTag:
l := len(value)
var ip, mask []byte
@@ -1261,11 +1276,11 @@
mask = value[16:]

default:
- return nil, nil, nil, nil, fmt.Errorf("x509: IP constraint contained value of length %d", l)
+ return nil, nil, nil, nil, nil, fmt.Errorf("x509: IP constraint contained value of length %d", l)
}

if !isValidIPMask(mask) {
- return nil, nil, nil, nil, fmt.Errorf("x509: IP constraint contained invalid mask %x", mask)
+ return nil, nil, nil, nil, nil, fmt.Errorf("x509: IP constraint contained invalid mask %x", mask)
}

ips = append(ips, &net.IPNet{IP: net.IP(ip), Mask: net.IPMask(mask)})
@@ -1273,14 +1288,14 @@
case emailTag:
constraint := string(value)
if err := isIA5String(constraint); err != nil {
- return nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error())
+ return nil, nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error())
}

// If the constraint contains an @ then
// it specifies an exact mailbox name.
if strings.Contains(constraint, "@") {
if _, ok := parseRFC2821Mailbox(constraint); !ok {
- return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint)
+ return nil, nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint)
}
} else {
// Otherwise it's a domain name.
@@ -1289,7 +1304,7 @@
domain = domain[1:]
}
if _, ok := domainToReverseLabels(domain); !ok {
- return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint)
+ return nil, nil, nil, nil, nil, fmt.Errorf("x509: failed to parse rfc822Name constraint %q", constraint)
}
}
emails = append(emails, constraint)
@@ -1297,11 +1312,11 @@
case uriTag:
domain := string(value)
if err := isIA5String(domain); err != nil {
- return nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error())
+ return nil, nil, nil, nil, nil, errors.New("x509: invalid constraint value: " + err.Error())
}

if net.ParseIP(domain) != nil {
- return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse URI constraint %q: cannot be IP address", domain)
+ return nil, nil, nil, nil, nil, fmt.Errorf("x509: failed to parse URI constraint %q: cannot be IP address", domain)
}

trimmedDomain := domain
@@ -1313,7 +1328,7 @@
trimmedDomain = trimmedDomain[1:]
}
if _, ok := domainToReverseLabels(trimmedDomain); !ok {
- return nil, nil, nil, nil, fmt.Errorf("x509: failed to parse URI constraint %q", domain)
+ return nil, nil, nil, nil, nil, fmt.Errorf("x509: failed to parse URI constraint %q", domain)
}
uriDomains = append(uriDomains, domain)

@@ -1322,13 +1337,13 @@
}
}

- return dnsNames, ips, emails, uriDomains, nil
+ return dirNames, dnsNames, ips, emails, uriDomains, nil
}

- if out.PermittedDNSDomains, out.PermittedIPRanges, out.PermittedEmailAddresses, out.PermittedURIDomains, err = getValues(permitted); err != nil {
+ if out.PermittedDirNames, out.PermittedDNSDomains, out.PermittedIPRanges, out.PermittedEmailAddresses, out.PermittedURIDomains, err = getValues(permitted); err != nil {
return false, err
}
- if out.ExcludedDNSDomains, out.ExcludedIPRanges, out.ExcludedEmailAddresses, out.ExcludedURIDomains, err = getValues(excluded); err != nil {
+ if out.ExcludedDirNames, out.ExcludedDNSDomains, out.ExcludedIPRanges, out.ExcludedEmailAddresses, out.ExcludedURIDomains, err = getValues(excluded); err != nil {
return false, err
}
out.PermittedDNSDomainsCritical = e.Critical

To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
Gerrit-Change-Number: 238362
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-MessageType: newchange

Gobot Gobot (Gerrit)

unread,
Jun 17, 2020, 1:56:46 AM6/17/20
to Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://golang.org/doc/contribute.html#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11 or adds a tag like "wait-release", it means that this CL will be
reviewed as part of the next development cycle. See https://golang.org/s/release
for more details.

View Change

    To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
    Gerrit-Change-Number: 238362
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gobot Gobot <go...@golang.org>
    Gerrit-Comment-Date: Wed, 17 Jun 2020 05:56:43 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Paul van Brouwershaven (Gerrit)

    unread,
    Jun 17, 2020, 8:09:20 AM6/17/20
    to Gerrit Bot, goph...@pubsubhelper.golang.org, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

    Thanks for your contribution, I would really appreciate if we can finally handle directory name constraints in Go.

    Don't forget to extend the test cases to cover different scenarios with directory based name constraints!

    Besides the ones I listed in #15196, you can find some example certificates with directory name constraints here:
    https://censys.io/certificates?q=parsed.extensions.name_constraints.excluded_directory_names%3A%2A

    But maybe it's easier to just generate some certificate to cover the different directory name constraint test scenarios.

    View Change

      To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
      Gerrit-Change-Number: 238362
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
      Gerrit-CC: Adam Langley <a...@golang.org>
      Gerrit-CC: Gobot Gobot <go...@golang.org>
      Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
      Gerrit-CC: Russ Cox <r...@golang.org>
      Gerrit-Comment-Date: Wed, 17 Jun 2020 12:09:14 +0000

      Paul van Brouwershaven (Gerrit)

      unread,
      Jun 17, 2020, 8:14:09 AM6/17/20
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

      Sorry, included the wrong Censys search query, this one includes the permitted ones which make more sense.

      https://censys.io/certificates?q=parsed.extensions.name_constraints.excluded_directory_names%3A*+OR+parsed.extensions.name_constraints.permitted_directory_names%3A*

      View Change

        To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
        Gerrit-Change-Number: 238362
        Gerrit-PatchSet: 1
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Gobot Gobot <go...@golang.org>
        Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
        Gerrit-CC: Russ Cox <r...@golang.org>
        Gerrit-Comment-Date: Wed, 17 Jun 2020 12:14:04 +0000

        Luiz Angelo Daros de Luca (Gerrit)

        unread,
        Jun 17, 2020, 12:34:47 PM6/17/20
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

        Thanks Paul, some example certs might help speed up tests. Anyway, I know how to do it from scratch.

        I just posted it sooner without tests to get some feedback on code. This is my first day with golang. I just want to know if this is the right track to follow and it just need some fix to get accepted.

        I will try to get some tests working.

        View Change

          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
          Gerrit-Change-Number: 238362
          Gerrit-PatchSet: 1
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
          Gerrit-CC: Adam Langley <a...@golang.org>
          Gerrit-CC: Gobot Gobot <go...@golang.org>
          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
          Gerrit-CC: Russ Cox <r...@golang.org>
          Gerrit-Comment-Date: Wed, 17 Jun 2020 13:27:54 +0000

          Gerrit Bot (Gerrit)

          unread,
          Jun 17, 2020, 8:07:39 PM6/17/20
          to Luiz Angelo Daros de Luca, Filippo Valsorda, goph...@pubsubhelper.golang.org, Gobot Gobot, Paul van Brouwershaven, Russ Cox, Adam Langley, golang-co...@googlegroups.com

          Gerrit Bot uploaded patch set #2 to this change.

          View Change

          crypto/x509: add directory name constraints (WIP)

          It is still missing tests.

          Fixes #15196

          This is my first day using golang. So, this PR might have newbie codes that might require improvements.

          I'm reparsing Subject in order to compare it. However, Certificate class could keep a RDNSequence and save some cycles.

          It might be a better way to do the dirname compassion (without using three nested for).

          Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
          GitHub-Last-Rev: 70bf4843fb8f65303d86321abacad172424cd537

          GitHub-Pull-Request: golang/go#39639
          ---
          M src/crypto/x509/verify.go
          M src/crypto/x509/verify_test.go
          M src/crypto/x509/x509.go
          3 files changed, 1,179 insertions(+), 19 deletions(-)

          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
          Gerrit-Change-Number: 238362
          Gerrit-PatchSet: 2
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
          Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
          Gerrit-CC: Adam Langley <a...@golang.org>
          Gerrit-CC: Gobot Gobot <go...@golang.org>
          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
          Gerrit-CC: Russ Cox <r...@golang.org>
          Gerrit-MessageType: newpatchset

          Luiz Angelo Daros de Luca (Gerrit)

          unread,
          Jun 17, 2020, 8:21:02 PM6/17/20
          to Gerrit Bot, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

          I added tests. I created a bunch of certificates and validated them against openssl.
          After that, I added the same test to golang.

          It uncovered a bug where dirname constraints was only validating leaf certificate against the chain,
          while it should also validate intermediate CAs against it.

          I still want to test if I a subCA could (wrongly) relax a constraint (adding extra permitted).
          I didn't check the code but it looks like all permmited/excluded constraints are grouped into the leaf certificate instead of individually checking each CA for restrictions. For example:

          If we join permits, you'll allow leaf certificates to use example.com and example2.com while it should only allow x.example.com

          View Change

            To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
            Gerrit-Change-Number: 238362
            Gerrit-PatchSet: 2
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
            Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
            Gerrit-CC: Adam Langley <a...@golang.org>
            Gerrit-CC: Gobot Gobot <go...@golang.org>
            Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
            Gerrit-CC: Russ Cox <r...@golang.org>
            Gerrit-Comment-Date: Thu, 18 Jun 2020 00:20:57 +0000

            Gerrit Bot (Gerrit)

            unread,
            Jun 17, 2020, 9:32:58 PM6/17/20
            to Luiz Angelo Daros de Luca, Filippo Valsorda, goph...@pubsubhelper.golang.org, Gobot Gobot, Paul van Brouwershaven, Russ Cox, Adam Langley, golang-co...@googlegroups.com

            Gerrit Bot uploaded patch set #3 to this change.

            View Change

            crypto/x509: add directory name constraints (WIP)

            It is still missing tests.

            Fixes #15196

            This is my first day using golang. So, this PR might have newbie codes that might require improvements.

            I'm reparsing Subject in order to compare it. However, Certificate class could keep a RDNSequence and save some cycles.

            It might be a better way to do the dirname compassion (without using three nested for).

            Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
            GitHub-Last-Rev: 7285b7bfdb8708d280100ab01e0d640da162116d

            GitHub-Pull-Request: golang/go#39639
            ---
            M src/crypto/x509/verify.go
            M src/crypto/x509/verify_test.go
            M src/crypto/x509/x509.go
            3 files changed, 1,179 insertions(+), 19 deletions(-)

            To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
            Gerrit-Change-Number: 238362
            Gerrit-PatchSet: 3
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
            Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
            Gerrit-CC: Adam Langley <a...@golang.org>
            Gerrit-CC: Gobot Gobot <go...@golang.org>
            Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
            Gerrit-CC: Russ Cox <r...@golang.org>
            Gerrit-MessageType: newpatchset

            Luiz Angelo Daros de Luca (Gerrit)

            unread,
            Jun 17, 2020, 9:33:44 PM6/17/20
            to Gerrit Bot, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

            I still want to test if I a subCA could (wrongly) relax a constraint (adding extra permitted).

            All good. I added some more tests related to this and they were all clear.

            View Change

              To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
              Gerrit-Change-Number: 238362
              Gerrit-PatchSet: 2
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
              Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
              Gerrit-CC: Adam Langley <a...@golang.org>
              Gerrit-CC: Gobot Gobot <go...@golang.org>
              Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
              Gerrit-CC: Russ Cox <r...@golang.org>
              Gerrit-Comment-Date: Thu, 18 Jun 2020 01:33:37 +0000

              Luiz Angelo Daros de Luca (Gerrit)

              unread,
              Jun 17, 2020, 9:35:11 PM6/17/20
              to Gerrit Bot, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

              I would like to update commit message (just removing extra commends)

              View Change

                To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                Gerrit-Project: go
                Gerrit-Branch: master
                Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                Gerrit-Change-Number: 238362
                Gerrit-PatchSet: 3
                Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                Gerrit-CC: Adam Langley <a...@golang.org>
                Gerrit-CC: Gobot Gobot <go...@golang.org>
                Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                Gerrit-CC: Russ Cox <r...@golang.org>
                Gerrit-Comment-Date: Thu, 18 Jun 2020 01:35:06 +0000

                Paul van Brouwershaven (Gerrit)

                unread,
                Jun 18, 2020, 7:49:40 AM6/18/20
                to Gerrit Bot, Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

                Thanks for adding these tests, this should really help to get this go through when some of the Go team look at this.

                I also noticed that you currently only parse and validate the directory name constraints, can you make sure that they will also be marshalled when creating a new certificate?

                View Change

                  To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                  Gerrit-Change-Number: 238362
                  Gerrit-PatchSet: 3
                  Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                  Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                  Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                  Gerrit-CC: Adam Langley <a...@golang.org>
                  Gerrit-CC: Gobot Gobot <go...@golang.org>
                  Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                  Gerrit-CC: Russ Cox <r...@golang.org>
                  Gerrit-Comment-Date: Thu, 18 Jun 2020 11:49:34 +0000

                  DO NOT USE (Gerrit)

                  unread,
                  Jun 18, 2020, 1:28:28 PM6/18/20
                  to Gerrit Bot, Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

                  Luiz, thank you for contributing. Before we can move to the implementation and code review, we should decide on the issue tracker that we want to add this feature.

                  You can help that discussion by explaining there what you need it for.

                  View Change

                    To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-Project: go
                    Gerrit-Branch: master
                    Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                    Gerrit-Change-Number: 238362
                    Gerrit-PatchSet: 3
                    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                    Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                    Gerrit-CC: Adam Langley <a...@golang.org>
                    Gerrit-CC: DO NOT USE <vals...@google.com>
                    Gerrit-CC: Gobot Gobot <go...@golang.org>
                    Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                    Gerrit-CC: Russ Cox <r...@golang.org>
                    Gerrit-Comment-Date: Thu, 18 Jun 2020 17:28:23 +0000

                    Luiz Angelo Daros de Luca (Gerrit)

                    unread,
                    Jun 18, 2020, 2:38:37 PM6/18/20
                    to Gerrit Bot, goph...@pubsubhelper.golang.org, DO NOT USE, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

                    You can help that discussion by explaining there what you need it for.

                    You mean to discuss here?
                    https://github.com/golang/go/issues/15196#issuecomment-645079361

                    I already posted there before this PR. In summary:

                    1. It's mandatory (MUST) by RFC5280 in contrast of all other name constraints (which Go already implements). Does 'not respecting RFC5280' qualify this issue as a bug?
                    2. It breaks any PKI that uses directory name constraints (like my case). It's not a simple 'does not check'. It rejects any TLS conn.
                    3. It is generally used in Windows AD CA to limit SubCA for subdomains, avoiding them to generate a certificate for a high level domain.

                    View Change

                      To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                      Gerrit-Project: go
                      Gerrit-Branch: master
                      Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                      Gerrit-Change-Number: 238362
                      Gerrit-PatchSet: 3
                      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                      Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                      Gerrit-CC: Adam Langley <a...@golang.org>
                      Gerrit-CC: DO NOT USE <vals...@google.com>
                      Gerrit-CC: Gobot Gobot <go...@golang.org>
                      Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                      Gerrit-CC: Russ Cox <r...@golang.org>
                      Gerrit-Comment-Date: Thu, 18 Jun 2020 18:38:31 +0000

                      Paul van Brouwershaven (Gerrit)

                      unread,
                      Jun 18, 2020, 2:51:11 PM6/18/20
                      to Gerrit Bot, Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, DO NOT USE, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

                      I would say another good argument for this is that there are over 180 publicly trusted and non expired issuing CA's with directory name constraints (see my Censys link earlier).

                      View Change

                        To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                        Gerrit-Change-Number: 238362
                        Gerrit-PatchSet: 3
                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                        Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                        Gerrit-CC: Adam Langley <a...@golang.org>
                        Gerrit-CC: DO NOT USE <vals...@google.com>
                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                        Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                        Gerrit-CC: Russ Cox <r...@golang.org>
                        Gerrit-Comment-Date: Thu, 18 Jun 2020 18:51:03 +0000

                        Gerrit Bot (Gerrit)

                        unread,
                        Jun 18, 2020, 7:23:13 PM6/18/20
                        to Luiz Angelo Daros de Luca, Filippo Valsorda, goph...@pubsubhelper.golang.org, Gobot Gobot, DO NOT USE, Paul van Brouwershaven, Russ Cox, Adam Langley, golang-co...@googlegroups.com

                        Gerrit Bot uploaded patch set #4 to this change.

                        View Change

                        crypto/x509: add directory name constraints (WIP)

                        It is still missing tests.

                        Fixes #15196

                        This is my first day using golang. So, this PR might have newbie codes that might require improvements.

                        I'm reparsing Subject in order to compare it. However, Certificate class could keep a RDNSequence and save some cycles.

                        It might be a better way to do the dirname compassion (without using three nested for).

                        Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                        GitHub-Last-Rev: e44eb9fbe75aaa50a29ad5abb61b2eb110fed46e

                        GitHub-Pull-Request: golang/go#39639
                        ---
                        M src/crypto/x509/verify.go
                        M src/crypto/x509/verify_test.go
                        M src/crypto/x509/x509.go
                        M src/crypto/x509/x509_test.go
                        4 files changed, 1,454 insertions(+), 23 deletions(-)

                        To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                        Gerrit-Change-Number: 238362
                        Gerrit-PatchSet: 4
                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                        Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                        Gerrit-CC: Adam Langley <a...@golang.org>
                        Gerrit-CC: DO NOT USE <vals...@google.com>
                        Gerrit-CC: Gobot Gobot <go...@golang.org>
                        Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                        Gerrit-CC: Russ Cox <r...@golang.org>
                        Gerrit-MessageType: newpatchset

                        Luiz Angelo Daros de Luca (Gerrit)

                        unread,
                        Jun 18, 2020, 7:29:55 PM6/18/20
                        to Gerrit Bot, goph...@pubsubhelper.golang.org, DO NOT USE, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gobot Gobot, golang-co...@googlegroups.com

                        I also noticed that you currently only parse and validate the directory name constraints, can you make sure that they will also be marshalled when creating a new certificate?

                        I didn't know go API was also capable of creating certificates. I added the needed code and also expanded the existing mashall/unmarshall test.

                        View Change

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 3
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: DO NOT USE <vals...@google.com>
                          Gerrit-CC: Gobot Gobot <go...@golang.org>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-Comment-Date: Thu, 18 Jun 2020 23:29:49 +0000

                          Gerrit Bot (Gerrit)

                          unread,
                          Jul 30, 2020, 6:04:21 PM7/30/20
                          to Luiz Angelo Daros de Luca, Filippo Valsorda, goph...@pubsubhelper.golang.org, Gobot Gobot, DO NOT USE, Paul van Brouwershaven, Russ Cox, Adam Langley, golang-co...@googlegroups.com

                          Gerrit Bot uploaded patch set #5 to this change.

                          View Change

                          crypto/x509: add directory name constraints

                          It is still missing tests.

                          Fixes #15196

                          This is my first day using golang. So, this PR might have newbie codes that might require improvements.

                          I'm reparsing Subject in order to compare it. However, Certificate class could keep a RDNSequence and save some cycles.

                          It might be a better way to do the dirname compassion (without using three nested for).

                          Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          GitHub-Last-Rev: e44eb9fbe75aaa50a29ad5abb61b2eb110fed46e
                          GitHub-Pull-Request: golang/go#39639
                          ---
                          M src/crypto/x509/verify.go
                          M src/crypto/x509/verify_test.go
                          M src/crypto/x509/x509.go
                          M src/crypto/x509/x509_test.go
                          4 files changed, 1,454 insertions(+), 23 deletions(-)

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 5
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: DO NOT USE <vals...@google.com>
                          Gerrit-CC: Gobot Gobot <go...@golang.org>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-MessageType: newpatchset

                          Gerrit Bot (Gerrit)

                          unread,
                          Jul 30, 2020, 7:14:43 PM7/30/20
                          to Luiz Angelo Daros de Luca, Filippo Valsorda, goph...@pubsubhelper.golang.org, Gobot Gobot, DO NOT USE, Paul van Brouwershaven, Russ Cox, Adam Langley, golang-co...@googlegroups.com

                          Gerrit Bot uploaded patch set #6 to this change.

                          View Change

                          crypto/x509: add directory name constraints

                          Fixes #15196


                          Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          GitHub-Last-Rev: e44eb9fbe75aaa50a29ad5abb61b2eb110fed46e
                          GitHub-Pull-Request: golang/go#39639
                          ---
                          M src/crypto/x509/verify.go
                          M src/crypto/x509/verify_test.go
                          M src/crypto/x509/x509.go
                          M src/crypto/x509/x509_test.go
                          4 files changed, 1,454 insertions(+), 23 deletions(-)

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 6

                          Gerrit Bot (Gerrit)

                          unread,
                          Oct 16, 2020, 3:11:43 PM10/16/20
                          to Luiz Angelo Daros de Luca, Filippo Valsorda, goph...@pubsubhelper.golang.org, Go Bot, Paul van Brouwershaven, Russ Cox, Adam Langley, golang-co...@googlegroups.com

                          Gerrit Bot uploaded patch set #7 to this change.

                          View Change

                          crypto/x509: add directory name constraints

                          Fixes #15196

                          Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          GitHub-Last-Rev: a3b93f5e2b0c082ca72d39083b4be60339f69c40

                          GitHub-Pull-Request: golang/go#39639
                          ---
                          M src/crypto/x509/verify.go
                          M src/crypto/x509/verify_test.go
                          M src/crypto/x509/x509.go
                          M src/crypto/x509/x509_test.go
                          4 files changed, 1,454 insertions(+), 23 deletions(-)

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 7
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Go Bot <go...@golang.org>

                          Luiz Angelo Daros de Luca (Gerrit)

                          unread,
                          Feb 22, 2021, 3:32:46 PM2/22/21
                          to Gerrit Bot, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Go Bot, golang-co...@googlegroups.com

                          View Change

                          1 comment:

                          • Patchset:

                            • Patch Set #7:

                              Hello,

                              As go 1.16 was released, wouldn't it be a good time to merge?

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 7
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-Reviewer: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Go Bot <go...@golang.org>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-Comment-Date: Mon, 22 Feb 2021 20:32:39 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No
                          Gerrit-MessageType: comment

                          Gerrit Bot (Gerrit)

                          unread,
                          Sep 21, 2021, 5:27:53 PM9/21/21
                          to Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

                          Gerrit Bot uploaded patch set #8 to this change.

                          View Change

                          crypto/x509: add directory name constraints

                          Fixes #15196

                          Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          GitHub-Last-Rev: eef1cd3020577110ca4fd0138240771bb4dad45f
                          GitHub-Pull-Request: golang/go#39639
                          ---
                          M src/crypto/x509/parser.go

                          M src/crypto/x509/verify.go
                          M src/crypto/x509/verify_test.go
                          M src/crypto/x509/x509.go
                          M src/crypto/x509/x509_test.go
                          5 files changed, 1,454 insertions(+), 23 deletions(-)

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 8
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Go Bot <go...@golang.org>
                          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-MessageType: newpatchset

                          Gopher Robot (Gerrit)

                          unread,
                          Dec 15, 2021, 2:52:51 PM12/15/21
                          to Gerrit Dou, Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, golang-co...@googlegroups.com

                          Gopher Robot abandoned this change.

                          View Change

                          Abandoned GitHub PR golang/go#39639 has been closed.

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 8
                          Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-MessageType: abandon

                          Ian Lance Taylor (Gerrit)

                          unread,
                          Dec 16, 2021, 12:36:45 AM12/16/21
                          to Gerrit Dou, Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

                          Ian Lance Taylor restored this change.

                          View Change

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 8
                          Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-MessageType: restore

                          Gerrit Bot (Gerrit)

                          unread,
                          May 23, 2022, 10:05:02 PM5/23/22
                          to Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

                          Gerrit Bot uploaded patch set #9 to this change.

                          View Change

                          crypto/x509: add directory name constraints

                          Fixes #15196

                          Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          GitHub-Last-Rev: 56134a2cda0f92a46f6b6075d3cf84f9bf4cb60a

                          GitHub-Pull-Request: golang/go#39639
                          ---
                          M src/crypto/x509/parser.go
                          M src/crypto/x509/verify.go
                          M src/crypto/x509/verify_test.go
                          M src/crypto/x509/x509.go
                          M src/crypto/x509/x509_test.go
                          5 files changed, 1,466 insertions(+), 23 deletions(-)

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 9
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-MessageType: newpatchset

                          Gerrit Bot (Gerrit)

                          unread,
                          Feb 27, 2023, 3:14:26 PM2/27/23
                          to Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

                          Attention is currently required from: Filippo Valsorda.

                          Gerrit Bot uploaded patch set #10 to this change.

                          View Change

                          crypto/x509: add directory name constraints

                          Fixes #15196

                          Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          GitHub-Last-Rev: 6ba02dd14e5d7756b54853f760fdf797ef02e6be

                          GitHub-Pull-Request: golang/go#39639
                          ---
                          M src/crypto/x509/parser.go
                          M src/crypto/x509/verify.go
                          M src/crypto/x509/verify_test.go
                          M src/crypto/x509/x509.go
                          M src/crypto/x509/x509_test.go
                          5 files changed, 1,453 insertions(+), 23 deletions(-)

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 10
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
                          Gerrit-MessageType: newpatchset

                          Luiz Angelo Daros de Luca (Gerrit)

                          unread,
                          Sep 25, 2023, 1:11:52 PM9/25/23
                          to Gerrit Bot, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

                          Attention is currently required from: Filippo Valsorda.

                          View Change

                          2 comments:

                          • Patchset:

                            • Patch Set #7:

                              Hello, […]

                              What do I need to fix to get this merged (or someone provides a similar feature). It is not funny to maintain out-of-tree patches.

                          • Patchset:

                            • Patch Set #10:

                              What do I need to fix to get this merged (or someone provides a similar feature). It is not funny to maintain out-of-tree patches.

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-MessageType: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 10
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
                          Gerrit-Comment-Date: Mon, 25 Sep 2023 17:11:46 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No
                          Comment-In-Reply-To: Luiz Angelo Daros de Luca <luiz...@gmail.com>

                          t hepudds (Gerrit)

                          unread,
                          Sep 25, 2023, 2:18:22 PM9/25/23
                          to Gerrit Bot, Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

                          Attention is currently required from: Filippo Valsorda, Luiz Angelo Daros de Luca.

                          View Change

                          1 comment:

                          • Patchset:

                            • Patch Set #7:

                              What do I need to fix to get this merged (or someone provides a similar feature). […]

                              Hi Luiz, I can't comment on whether or not your changes are desirable (I'm just a random gopher from the broader community), but a few quick comments that might help:

                              1. In general, it's easier for a reviewer to review a change if the commit message contains more details than just "Fixes #nnnn". As the [Contribution Guide](https://go.dev/doc/contribute#main_content) suggests, the commit description should provide context and rationale for the change and explain what it does.

                              2. In this particular case, issue #15196 is somewhat old and involved, including it is long enough that GitHub has started to hide some of the comments by default until they are manually expanded. It would probably be worthwhile to at least briefly summarize or touch some of the history in the commit message for this CL. (Maybe as short as -- "Adam Langley added support for XXXX in CL YYYY, but left ZZZZ as something for the future, which this CL now attempts to address.").

                              3. The #15196 issue is still listed as "NeedsDecision", so it might help to get a decision on the GitHub issue. (As the Contribution Guide also says -- "Consensus should have been reached on the tracker before proceeding... Gerrit reviews do not discuss the merit of the change, just its implementation").

                              4. Finally, in case this helps -- the commit title and commit message body come from the GitHub PR title and description, and must be edited in the GitHub web interface (not via git). For instructions, see [here](https://go.dev/wiki/GerritBot/#how-does-gerritbot-determine-the-final-commit-message).

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-MessageType: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 10
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-CC: t hepudds <thepud...@gmail.com>
                          Gerrit-Attention: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
                          Gerrit-Comment-Date: Mon, 25 Sep 2023 18:18:16 +0000

                          Luiz Angelo Daros de Luca (Gerrit)

                          unread,
                          Sep 25, 2023, 3:24:01 PM9/25/23
                          to Gerrit Bot, goph...@pubsubhelper.golang.org, t hepudds, Paul van Brouwershaven, Filippo Valsorda, Adam Langley, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

                          Attention is currently required from: Filippo Valsorda, t hepudds.

                          View Change

                          1 comment:

                          • Patchset:

                            • Patch Set #7:

                              Hi Luiz, I can't comment on whether or not your changes are desirable (I'm just a random gopher from the broader community), but a few quick comments that might help:

                            • 1. In general, it's easier for a reviewer to review a change if the commit message contains more details than just "Fixes #nnnn". As the [Contribution Guide](https://go.dev/doc/contribute#main_content) suggests, the commit description should provide context and rationale for the change and explain what it does.

                            • 2. In this particular case, issue #15196 is somewhat old and involved, including it is long enough that GitHub has started to hide some of the comments by default until they are manually expanded. It would probably be worthwhile to at least briefly summarize or touch some of the history in the commit message for this CL. (Maybe as short as -- "Adam Langley added support for XXXX in CL YYYY, but left ZZZZ as something for the future, which this CL now attempts to address.").

                            • I'll add some comments about Adam Langley patch.

                            • 3. The #15196 issue is still listed as "NeedsDecision", so it might help to get a decision on the GitHub issue. (As the Contribution Guide also says -- "Consensus should have been reached on the tracker before proceeding... Gerrit reviews do not discuss the merit of the change, just its implementation").

                            • I'll update both the commit message and the github text.

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-MessageType: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 10
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
                          Gerrit-CC: Adam Langley <a...@golang.org>
                          Gerrit-CC: Gopher Robot <go...@golang.org>
                          Gerrit-CC: Luiz Angelo Daros de Luca <luiz...@gmail.com>
                          Gerrit-CC: Paul van Brouwershaven <pa...@vanbrouwershaven.com>
                          Gerrit-CC: Russ Cox <r...@golang.org>
                          Gerrit-CC: t hepudds <thepud...@gmail.com>
                          Gerrit-Attention: t hepudds <thepud...@gmail.com>
                          Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
                          Gerrit-Comment-Date: Mon, 25 Sep 2023 19:23:54 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No
                          Comment-In-Reply-To: t hepudds <thepud...@gmail.com>

                          Gerrit Bot (Gerrit)

                          unread,
                          Sep 25, 2023, 3:25:18 PM9/25/23
                          to Luiz Angelo Daros de Luca, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

                          Attention is currently required from: Filippo Valsorda, t hepudds.

                          Gerrit Bot uploaded patch set #11 to this change.

                          View Change

                          crypto/x509: add directory name constraints

                          Adam Langley implemented the optional part of name constraints
                          (9e76ce70701ceef8fbccfb953b33a2ae7fe0367c) left the directory name
                          validation, which is a mandatory part of RFC5280, section 4.2.1.10.

                          Fixes #15196

                          Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          GitHub-Last-Rev: d8148096c4a5ab2f49ceeb4aeba58c0a0ca2e651

                          GitHub-Pull-Request: golang/go#39639
                          ---
                          M src/crypto/x509/parser.go
                          M src/crypto/x509/verify.go
                          M src/crypto/x509/verify_test.go
                          M src/crypto/x509/x509.go
                          M src/crypto/x509/x509_test.go
                          5 files changed, 1,453 insertions(+), 23 deletions(-)

                          To view, visit change 238362. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-MessageType: newpatchset
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: Ie8d0d2a7bd865c0cf7b5ac2296e09d8248945d7e
                          Gerrit-Change-Number: 238362
                          Gerrit-PatchSet: 11
                          Reply all
                          Reply to author
                          Forward
                          0 new messages