-
Notifications
You must be signed in to change notification settings - Fork 18k
crypto/x509: RSA-PSS signatures on certificates should be encoded without optional NULLs #38014
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
Comments
If this is both a SHOULD in the RFC and the deployed behavior of OpenSSL, we should just do it, yeah. |
@FiloSottile The (trivial) fix is to remove the |
Not so fast! This turns out to violate https://github.com/mozilla/pkipolicy/blob/master/rootstore/policy.md#511-rsa which requires the NULL parameters. |
This is a long running problem, about which RFC 4055 captures some of the context:
RFC 8017 somewhat complicates this by then seemingly saying in the appendix ASN.1 module (which is... rather confusing) that omitting the parameters for |
So is this an OpenSSL bug rather than a Go bug? |
Eh, it kind of depends. OpenSSL isn't really doing anything wrong, it is totally standards compliant to omit the parameters field, but if someone is using OpenSSL to generate certificates that are intended to be publicly trusted under roots included in the Mozilla root program then they are violating the store policy. |
Should Mozilla’s policy be changed? |
I don't think so, no. The choice of the 4055 encoding was explicitly made to reduce the possible valid encodings to one. |
Circling back to this, I think it makes sense to document why this choice is made, and probably close this out as a wont-fix. |
Thank you for investigating. crypto/x509 targets primarily the WebPKI, so indeed we should follow the root stores policies. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Sign a certificate with RSASSA-PSS
What did you expect to see?
The
AlgorithmId
does not include the two optional NULL fields, which matches the behavior of OpenSSL and conforms to a SHOULD in RFC8017.What did you see instead?
The
AlgorithmId
does include the two optional NULL fields, which does not match the behavior of OpenSSL and does not conform to a SHOULD in RFC8017.The text was updated successfully, but these errors were encountered: