aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Reynes <philippe.reynes@softathome.com>2021-10-15 11:28:47 +0200
committerTom Rini <trini@konsulko.com>2021-10-26 15:26:45 -0400
commitb560c704d66edf30c32c2a588bc1d177750bb418 (patch)
tree4fc25c39519712ed5cd16beb1ea31739b292c1f6
parent32cc3929a173246bf55b2a602082cabd971fc71b (diff)
downloadu-boot-b560c704d66edf30c32c2a588bc1d177750bb418.zip
u-boot-b560c704d66edf30c32c2a588bc1d177750bb418.tar.gz
u-boot-b560c704d66edf30c32c2a588bc1d177750bb418.tar.bz2
lib: rsa: rsa-verify: also check that padding is not NULL
This commit adds a check on the padding in the function rsa_verify_key to avoid using a NULL pointer. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--lib/rsa/rsa-verify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c
index 600c93a..83f7564 100644
--- a/lib/rsa/rsa-verify.c
+++ b/lib/rsa/rsa-verify.c
@@ -340,7 +340,7 @@ static int rsa_verify_key(struct image_sign_info *info,
struct padding_algo *padding = info->padding;
int hash_len;
- if (!prop || !sig || !hash || !checksum)
+ if (!prop || !sig || !hash || !checksum || !padding)
return -EIO;
if (sig_len != (prop->num_bits / 8)) {