-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
core/crypto: restrict RSA keys to <= 8192 bits #2454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be that you missed a few cases? I'm less worried about the code path where you generate the RSA key yourself (although we should prevent that footgun as well), but more about those where the peer sends us its pubkey. What could path would be taken during the TLS / Noise handshake when we receive the peer's key?
Co-authored-by: Marten Seemann <[email protected]>
Co-authored-by: Marten Seemann <[email protected]>
* Error if RSA key is too big * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Fix rename * Make this var again so the tests work --------- Co-authored-by: Marten Seemann <[email protected]>
* Error if RSA key is too big * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Fix rename * Make this var again so the tests work --------- Co-authored-by: Marten Seemann <[email protected]>
* Error if RSA key is too big * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Fix rename * Make this var again so the tests work --------- Co-authored-by: Marten Seemann <[email protected]>
* Error if RSA key is too big * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Fix rename * Make this var again so the tests work --------- Co-authored-by: Marten Seemann <[email protected]>
* Error if RSA key is too big * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Fix rename * Make this var again so the tests work --------- Co-authored-by: Marten Seemann <[email protected]>
* Error if RSA key is too big * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Update core/crypto/rsa_common.go Co-authored-by: Marten Seemann <[email protected]> * Fix rename * Make this var again so the tests work --------- Co-authored-by: Marten Seemann <[email protected]>
Restrict the RSA key sizes we expect from peers. Protects us from spending a lot of compute on verifying signatures from big keys. Similar to libp2p/go-libp2p#2454 --------- Co-authored-by: achingbrain <[email protected]>
At a certain point these become too much effort to compute. This limits the max size.