]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lib: rsa: Also check for presence of r-squared property
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 7 May 2020 18:36:13 +0000 (20:36 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 15 May 2020 18:47:35 +0000 (14:47 -0400)
Better than crashing later if it is missing.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
lib/rsa/rsa-verify.c

index 80e817314b5867d692d5b656b45d9b9a5e90ff75..f7ae174cb059248bde4fd7b25115dedeeb424f8e 100644 (file)
@@ -445,7 +445,7 @@ static int rsa_verify_with_keynode(struct image_sign_info *info,
 
        prop.rr = fdt_getprop(blob, node, "rsa,r-squared", NULL);
 
-       if (!prop.num_bits || !prop.modulus) {
+       if (!prop.num_bits || !prop.modulus || !prop.rr) {
                debug("%s: Missing RSA key info", __func__);
                return -EFAULT;
        }