public inbox for u-boot@lists.denx.de
 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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox