lib: rsa: rsa-verify: also check that padding is not NULL
PATCH 1/1 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 <[email protected]>
--- lib/rsa/rsa-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rsa/rsa-verify.c +1 -1
@@ -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 )) {
Signature · 1 line
2.17.1
Quoted 9 lines · Philippe Reynes
This commit adds a check on the padding in the function
rsa_verify_keyto avoid using a NULL pointer.Signed-off-by Philippe Reynes <[email protected]>--- lib/rsa/rsa-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Simon Glass <[email protected]>
Quoted 5 lines · Philippe Reynes
This commit adds a check on the padding in the function
rsa_verify_keyto avoid using a NULL pointer.Signed-off-by Philippe Reynes <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom