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

Open
rolandshoemaker opened this issue Sep 1, 2020 · 3 comments
Labels
Milestone

Comments

@rolandshoemaker
Copy link
Member

@rolandshoemaker rolandshoemaker commented Sep 1, 2020

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
Member

@FiloSottile FiloSottile commented Sep 1, 2020

(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 label Sep 1, 2020
@FiloSottile FiloSottile added this to the Go1.16 milestone Sep 1, 2020
@tpaschalis
Copy link
Contributor

@tpaschalis tpaschalis commented Sep 2, 2020

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

@gopherbot gopherbot commented Sep 2, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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