-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Bound
RsaPublicKey::new
on 4096-bits; add ::new_large
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.
- Loading branch information
Showing
1 changed file
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters