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: rewrite the parser to use x/crypto/cryptobyte #44299

Closed
rolandshoemaker opened this issue Feb 16, 2021 · 4 comments
Closed

crypto/x509: rewrite the parser to use x/crypto/cryptobyte #44299

rolandshoemaker opened this issue Feb 16, 2021 · 4 comments
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rolandshoemaker
Copy link
Member

A x/crypto/cryptobyte parser has two advantages over an encoding/asn1 based parser: significant performance improvement due to avoiding reflection, and a much stricter profile/narrower security surface by only needing to support the X.509 profile rather than supporting all of the generic ASN.1 features.

https://go-review.googlesource.com/c/go/+/274234 contains a WIP rewrite which shows around 65% performance improvement and 70% reduction in memory allocations when parsing a typical web PKI certificate.

@rolandshoemaker rolandshoemaker added NeedsFix The path to resolution is known, but the work has not been done. early-in-cycle A change that should be done early in the 3 month dev cycle. labels Feb 16, 2021
@rolandshoemaker rolandshoemaker added this to the Go1.17 milestone Feb 16, 2021
@rolandshoemaker
Copy link
Member Author

rolandshoemaker commented Feb 16, 2021

Improving the performance of the parser could also address #35504, and if not exposing the cryptobyte based SAN parser to the tls package could also be a viable solution.

@gopherbot
Copy link

This issue is currently labeled as early-in-cycle for Go 1.17.
That time is now, so a friendly reminder to look at it again.

@ianlancetaylor
Copy link
Contributor

Is this going to happen for 1.17? Thanks.

@neild
Copy link
Contributor

neild commented May 26, 2021

This appears to have been completed in CL 274234.

@neild neild closed this as completed May 26, 2021
@golang golang locked and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. 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