-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: structure of nameconstraint in CSR #6542
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
fix: structure of nameconstraint in CSR #6542
Conversation
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
/retest |
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
/retest |
@tanujd11 I applied some additional cleanup changes, PTAL |
@inteon LGTM |
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
Thanks for fixing this issue @tanujd11 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: inteon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
return nil, err | ||
} | ||
nameConstraints.PermittedEmailAddresses = crt.Spec.NameConstraints.Permitted.EmailAddresses | ||
nameConstraints.ExcludedURIDomains = crt.Spec.NameConstraints.Permitted.URIDomains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, good catch!
If this bug is still present on master, could you maybe create a PR to fix this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, will create a PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @martin31821
Pull Request Motivation
This PR is a follow up from #6500. According to #6500 (comment) by @inteon the CSR should follow a proper structure mentioned in the RFC, The self signed certificate was generating correctly but CSR structure was not compatible with the RFC. This PR fixes the issue by using the x509.go to marshal the nameConstraints from the API and https://github.com/golang/go/blob/46ea4ab5cb87e9e5d443029f5f1a4bba012804d3/src/crypto/x509/parser.go#L483 for parsing the nameConstraint extension into a certificate.
Kind
FixRelease Note