@@ -27,14 +27,15 @@ library RSA {
27
27
28
28
/**
29
29
* @dev Verifies a PKCSv1.5 signature given a digest according to the verification
30
- * method described in https://datatracker.ietf.org/doc/html/rfc8017#section-8.2.2[section 8.2.2 of RFC8017] with support
31
- * for explicit or implicit NULL parameters in the DigestInfo (no other optional parameters are supported).
30
+ * method described in https://datatracker.ietf.org/doc/html/rfc8017#section-8.2.2[section 8.2.2 of RFC8017] with
31
+ * support for explicit or implicit NULL parameters in the DigestInfo (no other optional parameters are supported).
32
32
*
33
- * IMPORTANT: For security reason, this function requires the signature and modulus to have a length of at least 2048 bits.
34
- * If you use a smaller key, consider replacing it with a larger, more secure, one.
33
+ * IMPORTANT: For security reason, this function requires the signature and modulus to have a length of at least
34
+ * 2048 bits. If you use a smaller key, consider replacing it with a larger, more secure, one.
35
35
*
36
- * WARNING: PKCS#1 v1.5 allows for replayability given the message may contain arbitrary optional parameters in the
37
- * DigestInfo. Consider using an onchain nonce or unique identifier to include in the message to prevent replay attacks.
36
+ * WARNING: This verification algorithm doesn't prevent replayability. If called multiple times with the same
37
+ * digest, public key and (valid signature), it will return true every time. Consider including an onchain nonce or
38
+ * unique identifier in the message to prevent replay attacks.
38
39
*
39
40
* @param digest the digest to verify
40
41
* @param s is a buffer containing the signature
@@ -79,7 +80,7 @@ library RSA {
79
80
// - PS is padding filled with 0xFF
80
81
// - DigestInfo ::= SEQUENCE {
81
82
// digestAlgorithm AlgorithmIdentifier,
82
- // [optional algorithm parameters]
83
+ // [optional algorithm parameters] -- not currently supported
83
84
// digest OCTET STRING
84
85
// }
85
86
0 commit comments