-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/x509: add directory name constraints #39639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
This PR (HEAD: 4f8fbd3) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/238362 to see it. Tip: You can toggle comments from me using the |
Message from Gobot Gobot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Paul van Brouwershaven: Patch Set 1: 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: But maybe it's easier to just generate some certificate to cover the different directory name constraint test scenarios. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Paul van Brouwershaven: Patch Set 1: Sorry, included the wrong Censys search query, this one includes the permitted ones which make more sense. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 1: 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. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
This PR (HEAD: 70bf484) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/238362 to see it. Tip: You can toggle comments from me using the |
Message from Luiz Angelo Daros de Luca: Patch Set 2: I added tests. I created a bunch of certificates and validated them against openssl. It uncovered a bug where dirname constraints was only validating leaf certificate against the chain, I still want to test if I a subCA could (wrongly) relax a constraint (adding extra permitted).
If we join permits, you'll allow leaf certificates to use example.com and example2.com while it should only allow x.example.com Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
This PR (HEAD: 7285b7b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/238362 to see it. Tip: You can toggle comments from me using the |
Message from Luiz Angelo Daros de Luca: Patch Set 2:
All good. I added some more tests related to this and they were all clear. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 3: I would like to update commit message (just removing extra commends) Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Paul van Brouwershaven: Patch Set 3: 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? Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from DO NOT USE: Patch Set 3: 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. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 3:
You mean to discuss here? I already posted there before this PR. In summary:
Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Paul van Brouwershaven: Patch Set 3: 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). Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
This PR (HEAD: e44eb9f) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/238362 to see it. Tip: You can toggle comments from me using the |
Message from Luiz Angelo Daros de Luca: Patch Set 3:
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. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Go Bot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
e44eb9f
to
a3b93f5
Compare
This PR (HEAD: a3b93f5) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/238362 to see it. Tip: You can toggle comments from me using the |
Rebasing and conflict fix |
@heschi , could you please tell me why this was closed? |
It was due to #50197. Reopening. |
Thanks! |
This PR (HEAD: 56134a2) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/238362 to see it. Tip: You can toggle comments from me using the |
56134a2
to
6ba02dd
Compare
This PR (HEAD: 6ba02dd) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/238362 to see it. Tip: You can toggle comments from me using the |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Paul van Brouwershaven: Patch Set 1: 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: But maybe it's easier to just generate some certificate to cover the different directory name constraint test scenarios. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Paul van Brouwershaven: Patch Set 1: Sorry, included the wrong Censys search query, this one includes the permitted ones which make more sense. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 1: 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. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 2: I added tests. I created a bunch of certificates and validated them against openssl. It uncovered a bug where dirname constraints was only validating leaf certificate against the chain, I still want to test if I a subCA could (wrongly) relax a constraint (adding extra permitted).
If we join permits, you'll allow leaf certificates to use example.com and example2.com while it should only allow x.example.com Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 2:
All good. I added some more tests related to this and they were all clear. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 3: I would like to update commit message (just removing extra commends) Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Paul van Brouwershaven: Patch Set 3: 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? Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Filippo Valsorda: Patch Set 3: 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. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 3:
You mean to discuss here? I already posted there before this PR. In summary:
Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Paul van Brouwershaven: Patch Set 3: 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). Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 3:
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. Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from Luiz Angelo Daros de Luca: Patch Set 10: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Message from t hepudds: Patch Set 10: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Adam Langley implemented the optional part of name constraints (9e76ce7) left the directory name validation, which is a mandatory part of RFC5280, section 4.2.1.10. Fixes golang#15196
6ba02dd
to
d814809
Compare
@agl , this complements the name constraint you did before. |
This PR (HEAD: d814809) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/238362. Important tips:
|
Message from Luiz Angelo Daros de Luca: Patch Set 10: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/238362. |
Adam Langley implemented the optional part of name constraints
(9e76ce7) left the directory name
validation, which is a mandatory part of RFC5280, section 4.2.1.10.
Fixes #15196