[PATCH] 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 --- lib/rsa/rsa-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c index 600c93ab81..83f7564101 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)) {

On Fri, 15 Oct 2021 at 03:28, Philippe Reynes philippe.reynes@softathome.com wrote:
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
lib/rsa/rsa-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Fri, Oct 15, 2021 at 11:28:47AM +0200, Philippe Reynes wrote:
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
Applied to u-boot/master, thanks!
participants (3)
-
Philippe Reynes
-
Simon Glass
-
Tom Rini