crypto/x509: improve error message when signature algorithm is unsupported#77943
crypto/x509: improve error message when signature algorithm is unsupported#77943tobiasworkstech wants to merge 2 commits intogolang:masterfrom
Conversation
…orted When certificate chain verification fails because the CA's signature algorithm is not supported, the error was wrapped in an UnknownAuthorityError with the generic message: x509: certificate signed by unknown authority (possibly because of "x509: cannot verify signature: algorithm unimplemented" while trying to verify candidate authority certificate "CA Name") The phrase "signed by unknown authority" is misleading: the authority is known, but its signature algorithm cannot be verified. When hintErr is ErrUnsupportedAlgorithm, produce a clearer message instead: x509: certificate signed by unknown authority (the signature algorithm of authority certificate "CA Name" is not supported) Fixes golang#7735
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
I have now signed the Google Individual CLA. Please re-check. |
|
This PR (HEAD: 0f15c7f) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/751460. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/751460. |
|
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/751460. |
0f15c7f to
e06decb
Compare
|
This PR (HEAD: e06decb) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/751460. Important tips:
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes #7735
When certificate chain verification fails because the CA's signature
algorithm is not supported, the error was wrapped in an
UnknownAuthorityErrorproducing a misleading message:The phrase "signed by unknown authority" is confusing: the authority
certificate is known and found, but its signature algorithm cannot
be verified by this build of Go. The inner error string is accurate
but buried and obscured by the outer phrasing.
This change detects when
hintErrisErrUnsupportedAlgorithmandproduces a clearer, direct message instead:
The existing
expectHashErrortest is updated to match.