Skip to content

check_public improvements#170

Merged
tarcieri merged 1 commit intomasterfrom
check-public-improvements
Aug 7, 2022
Merged

check_public improvements#170
tarcieri merged 1 commit intomasterfrom
check-public-improvements

Conversation

@tarcieri
Copy link
Member

- Ensure modulus is 16384-bits or fewer. See #166
- Increase maximum public exponent. Closes #155
@tarcieri tarcieri requested a review from dignifiedquire July 30, 2022 20:52
tarcieri added a commit that referenced this pull request Jul 30, 2022
This commit fixes #166 by enforcing a 4096-bit upper limit by default,
which prevents potential DoS by using maliciously large RSA keys.

The PKCS#1/PKCS#8 parsers use this API, limiting the size of keys parsed
from these formats to 4096-bits.

An `RsaPrivateKey::new_large` constructor has been added which enforces
the 16384-bit limit added in #170. This can be used for unusual
applications that need to support larger keys.

`RsaPrivateKey::from_components` uses the `::new_large` constructor, so
private keys follow the 16384-bit limit only.

The `RsaPrivateKey::MAX_SIZE` and `RsaPrivateKey::MAX_SIZE_LARGE`
inherent constants specify the maximum allowed sizes.
@tarcieri tarcieri merged commit 8d3fe53 into master Aug 7, 2022
@tarcieri tarcieri deleted the check-public-improvements branch August 7, 2022 21:47
takumi-earth pushed a commit to earthlings-dev/RSA that referenced this pull request Jan 27, 2026
- Ensure modulus is 16384-bits or fewer. See RustCrypto#166
- Increase maximum public exponent. Closes RustCrypto#155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MAX_PUB_EXPONENT is somewhat small

1 participant