Skip to content
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: offer a useful error when ParsePKCS8PrivateKey/ParseECPrivateKey/ParsePKCS1PrivateKey or ParsePKIXPublicKey/ParsePKCS1PrivateKey are mixed up #30094

Closed
FiloSottile opened this issue Feb 5, 2019 · 3 comments

Comments

@FiloSottile
Copy link
Member

@FiloSottile FiloSottile commented Feb 5, 2019

When parsing fails in one of these functions, we could check if one of the others would have worked, and offer a helpful error message.

@arashbina
Copy link
Contributor

@arashbina arashbina commented Feb 6, 2019

I can work on this.
So if I understand correctly when unmarshalling to one structure if it fails try the counterpart to see if it succeeds and return a descriptive error.

@FiloSottile
Copy link
Member Author

@FiloSottile FiloSottile commented Feb 6, 2019

Correct. Please add me to the reviewers for the change. Thank you!

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 7, 2019

Change https://golang.org/cl/161557 mentions this issue: x509: improve error when PKCS1, PKCS8, EC, PKIX keys are mixed up

@gopherbot gopherbot closed this in 694ee61 Feb 27, 2019
@golang golang locked and limited conversation to collaborators Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.