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 80e8173..f7ae174 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;
        }