-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
crypto/x509: generate serial number for nil template SerialNumber #67675
Comments
I like this more than #52444 since it requires less code to use, and doesn't require handling an additional error return. I can't think of a reason to ever generate a standalone serial number. |
This proposal has been added to the active column of the proposals project |
Have all remaining concerns about this proposal been addressed? The proposal is to change CreateCertificate to handle a nil template.SerialNumber by generating a serial number according to RFC 5280, Section 4.1.2.2. The other create routines do not take templates with serial numbers and are unaffected. |
Based on the discussion above, this proposal seems like a likely accept. The proposal is to change CreateCertificate to handle a nil template.SerialNumber by generating a serial number according to RFC 5280, Section 4.1.2.2. The other create routines do not take templates with serial numbers and are unaffected. |
No change in consensus, so accepted. 🎉 The proposal is to change CreateCertificate to handle a nil template.SerialNumber by generating a serial number according to RFC 5280, Section 4.1.2.2. The other create routines do not take templates with serial numbers and are unaffected. |
Change https://go.dev/cl/630995 mentions this issue: |
@rolandshoemaker There's no API change here, but this still seems like a change that should be covered in Go 1.24 release notes, is that right? Mentioning it there will also help more people discover this new to Go 1.24 ability to take advantage of it. I'll reopen as a release blocker so this is easy to track; please update as needed. Thanks. |
Change https://go.dev/cl/631683 mentions this issue: |
Serial number generation is painfully complicated, especially if you want spec compliance. We've seen, over and over, that people get this wrong, even when trying to get it right.
We should provide an extremely simple way for people to get a correct serial easily. I propose that if the template passed to CreateCertificate contains a nil SerialNumber (currently an error), we will generate a conformant serial number, and add the following to the CreateCertificate documentation:
This is similar to, but somewhat different from, #52444. Either both, or just this proposal, could be implemented (the same logic would be used in both places).
The text was updated successfully, but these errors were encountered: