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/rsa: 4096 bit keys are not generated with BoringCrypto #58803

Open
FiloSottile opened this issue Mar 1, 2023 · 3 comments
Open

crypto/rsa: 4096 bit keys are not generated with BoringCrypto #58803

FiloSottile opened this issue Mar 1, 2023 · 3 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Security
Milestone

Comments

@FiloSottile
Copy link
Contributor

https://go.dev/cl/423362 updated the BoringCrypto module to one that supports RSA 4096 bit keys, and #41147 removed the limitation in crypto/x509, but crypto/rsa still has a check that only uses BoringCrypto for 2048 and 3078 bit keys, so 4096 bit keys are generated with the pure Go implementation.

/cc @golang/security @rsc

@FiloSottile FiloSottile added this to the Go1.21 milestone Mar 1, 2023
@bcmills bcmills added Security NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Mar 1, 2023
@FiloSottile
Copy link
Contributor Author

@gopherbot please open a Go 1.20 backport issue for this.

Go 1.20 updated the BoringCrypto module and started using BoringCrypto for RSA 4096 bit keys in crypto/x509, but not in GenerateKey. The two are not necessarily correlated (most X.509 keys are loaded from disk, not generated) but using unverified crypto unexpectedly is not great, and the fix is simple.

/cc @rsc @golang/security

@gopherbot
Copy link

Backport issue(s) opened: #58927 (for 1.20).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@gopherbot
Copy link

Change https://go.dev/cl/474515 mentions this issue: crypto/rsa: use BoringCrypto for 4096 bit keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Security
Projects
None yet
Development

No branches or pull requests

3 participants