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: CreateCertificate should return a meaningful error instead of panic when passed an unknown ExtKeyUsage #41169

Closed
rolandshoemaker opened this issue Sep 1, 2020 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rolandshoemaker
Copy link
Member

x509.CreateCertificate panics if passed a template containing an unknown ExtKeyUsage, example. Probably it'd make more sense to return an error along the lines of Unknown extended key usage.

@FiloSottile
Copy link
Contributor

(In general, I'd like all crypto functions with an error return value to stop ever returning a panic for any reason at all.)

@FiloSottile FiloSottile added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 1, 2020
@FiloSottile FiloSottile added this to the Go1.16 milestone Sep 1, 2020
@tpaschalis
Copy link
Contributor

I'll give this a shot tomorrow if there's no objection. I see three cases where a panic is called in the crypto/x509 package, we could possibly eliminate all of them.

@gopherbot
Copy link

Change https://golang.org/cl/252557 mentions this issue: crypto/x509: return error when passing unknown ExtKeyUsage

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants