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
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@FiloSottile
Copy link
Contributor

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.

@FiloSottile FiloSottile added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Feb 5, 2019
@FiloSottile FiloSottile added this to the Unplanned milestone Feb 5, 2019
@arashbina
Copy link
Contributor

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
Contributor Author

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

@gopherbot
Copy link

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

@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.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants