All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: rsa: rsa-verify: also check that padding is not NULL
@ 2021-10-15  9:28 Philippe Reynes
  2021-10-24 19:53 ` Simon Glass
  2021-10-26 22:41 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Reynes @ 2021-10-15  9:28 UTC (permalink / raw)
  To: mr.nuke.me, sjg; +Cc: u-boot, Philippe Reynes

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)) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] lib: rsa: rsa-verify: also check that padding is not NULL
  2021-10-15  9:28 [PATCH] lib: rsa: rsa-verify: also check that padding is not NULL Philippe Reynes
@ 2021-10-24 19:53 ` Simon Glass
  2021-10-26 22:41 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-10-24 19:53 UTC (permalink / raw)
  To: Philippe Reynes; +Cc: Alexandru Gagniuc, U-Boot Mailing List

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] lib: rsa: rsa-verify: also check that padding is not NULL
  2021-10-15  9:28 [PATCH] lib: rsa: rsa-verify: also check that padding is not NULL Philippe Reynes
  2021-10-24 19:53 ` Simon Glass
@ 2021-10-26 22:41 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-10-26 22:41 UTC (permalink / raw)
  To: Philippe Reynes; +Cc: mr.nuke.me, sjg, u-boot

[-- Attachment #1: Type: text/plain, Size: 343 bytes --]

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!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-26 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15  9:28 [PATCH] lib: rsa: rsa-verify: also check that padding is not NULL Philippe Reynes
2021-10-24 19:53 ` Simon Glass
2021-10-26 22:41 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.