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: Incorrect documentation for ParsePKCS8PrivateKey
#58789
Comments
CC @golang/security. |
Change https://go.dev/cl/472155 mentions this issue: |
Good catch, thank you! @gopherbot please open a backport issue to Go 1.20, this is a confusing documentation bug and it would be nice to get the fix live on pkg.go.dev before the next major release. |
Backport issue(s) opened: #58793 (for 1.20). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/472415 mentions this issue: |
Updates #58789. Fixes #58793. Change-Id: I91cdd20c6d4f05baaacd6a38717aa7bed6682573 Reviewed-on: https://go-review.googlesource.com/c/go/+/472155 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit ec26277) Reviewed-on: https://go-review.googlesource.com/c/go/+/472415 Reviewed-by: Filippo Valsorda <filippo@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Updates golang#58789. Fixes golang#58793. Change-Id: I91cdd20c6d4f05baaacd6a38717aa7bed6682573 Reviewed-on: https://go-review.googlesource.com/c/go/+/472155 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit ec26277) Reviewed-on: https://go-review.googlesource.com/c/go/+/472415 Reviewed-by: Filippo Valsorda <filippo@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Apologies for not following the template, it did not seem relevant since my issue is with the documentation of
crypto/x509
as it currently shows on https://pkg.go.dev/crypto/x509#ParsePKCS8PrivateKey. I also did not open this issue as a pkg.go.dev bug since it's an issue with the package's documentation, not the documentation website itself. If either decision was incorrect please let me know and I'll correct them.The documentation for
x509.ParsePKCS8PrivateKey
mentions the possible return types of the function as:However, in the case of X25519, the actual implementation returns a
*ecdh.PrivateKey
(ref), which makes more sense, and also fits with what typesx509.MarshalPKCS8PrivateKey
is documented to accept for thekey
parameter.Therefore it looks to me like the documentation is incorrect, and should instead be:
The text was updated successfully, but these errors were encountered: