Add comment about ensuring no other data follows the hash value in PKCS #1 Change-Id: I92419b7d2d8ded8f4868588ad3c24b70ac7f7b1b Reviewed-on: https://boringssl-review.googlesource.com/14864 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/crypto/rsa/rsa.c b/crypto/rsa/rsa.c index 6d56238..b26737d 100644 --- a/crypto/rsa/rsa.c +++ b/crypto/rsa/rsa.c
@@ -525,6 +525,8 @@ goto out; } + /* Check that no other information follows the hash value (FIPS 186-4 Section + * 5.5) and it matches the expected hash. */ if (len != signed_msg_len || OPENSSL_memcmp(buf, signed_msg, len) != 0) { OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_SIGNATURE); goto out;