aboutsummaryrefslogtreecommitdiff
path: root/lib/rsa/rsa-verify.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-09-15 09:59:47 -0400
committerTom Rini <trini@konsulko.com>2022-09-15 09:59:47 -0400
commitd9e85eeebabd5fc0c95be96bd70fa7362eb89f33 (patch)
treef3f4c2a9d5d19e8b548ce6ed98fbd5610d30bdd7 /lib/rsa/rsa-verify.c
parent1520af3f8450bb58168fe1cc827a56d435e9f74c (diff)
parent0cd933bb4bd74084d942c42098ebf9e07d9e0f63 (diff)
Merge branch '2022-09-15-general-improvements' into next
- Add uncompressed kernel image support to falcon mode, TEE improvements, make xyz-modem timeout configurable, gpio updates and other assorted improvements.
Diffstat (limited to 'lib/rsa/rsa-verify.c')
-rw-r--r--lib/rsa/rsa-verify.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c
index 1d95cfbdee..9605c37639 100644
--- a/lib/rsa/rsa-verify.c
+++ b/lib/rsa/rsa-verify.c
@@ -215,6 +215,8 @@ out:
* @msg_len: Message length
* @hash: Pointer to the expected hash
* @hash_len: Length of the hash
+ *
+ * Return: 0 if padding is correct, non-zero otherwise
*/
int padding_pss_verify(struct image_sign_info *info,
const uint8_t *msg, int msg_len,
@@ -234,6 +236,9 @@ int padding_pss_verify(struct image_sign_info *info,
uint8_t leftmost_mask;
struct checksum_algo *checksum = info->checksum;
+ if (db_len <= 0)
+ return -EINVAL;
+
/* first, allocate everything */
db_mask = malloc(db_len);
db = malloc(db_len);