From patchwork Thu May 7 18:36:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 245285 List-Id: U-Boot discussion From: jan.kiszka at siemens.com (Jan Kiszka) Date: Thu, 7 May 2020 20:36:13 +0200 Subject: [PATCH] lib: rsa: Also check for presence of r-squared property Message-ID: <4d07c3f1-25b9-50c5-ce43-a4402e560afe@siemens.com> From: Jan Kiszka Better than crashing later if it is missing. Signed-off-by: Jan Kiszka --- 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 80e817314b..f7ae174cb0 100644 --- a/lib/rsa/rsa-verify.c +++ b/lib/rsa/rsa-verify.c @@ -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; }