Add warning about low public key exponent (#5234)

Co-authored-by: Ernesto García <ernestognw@gmail.com>
This commit is contained in:
Hadrien Croubois
2024-10-01 19:50:58 +02:00
committed by GitHub
parent b72e3da0ec
commit 49cd64565a

View File

@ -36,8 +36,12 @@ library RSA {
* 2048 bits. If you use a smaller key, consider replacing it with a larger, more secure, one. * 2048 bits. If you use a smaller key, consider replacing it with a larger, more secure, one.
* *
* WARNING: This verification algorithm doesn't prevent replayability. If called multiple times with the same * WARNING: This verification algorithm doesn't prevent replayability. If called multiple times with the same
* digest, public key and (valid signature), it will return true every time. Consider including an onchain nonce or * digest, public key and (valid signature), it will return true every time. Consider including an onchain nonce
* unique identifier in the message to prevent replay attacks. * or unique identifier in the message to prevent replay attacks.
*
* WARNING: This verification algorithm supports any exponent. NIST recommends using `65537` (or higher).
* That is the default value many libraries use, such as OpenSSL. Developers may choose to reject public keys
* using a low exponent out of security concerns.
* *
* @param digest the digest to verify * @param digest the digest to verify
* @param s is a buffer containing the signature * @param s is a buffer containing the signature