From: Seung-Woo Kim Date: Thu, 1 Aug 2024 00:53:43 +0000 (+0900) Subject: tools: imagetool: Remove unnecessary check from toc0_verify_cert_item() X-Git-Tag: accepted/tizen/unified/20240806.010530^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c54502746919f758bfccedc97757604a40361199;p=platform%2Fkernel%2Fu-boot.git tools: imagetool: Remove unnecessary check from toc0_verify_cert_item() Remove unnecessary null check from toc0_verify_cert_item() because the array digest is always not null. Change-Id: I0d7f464a6528d89824b533a4224a62113d005291 Ref: https://patchwork.ozlabs.org/project/uboot/patch/20240801010100.21009-1-sw0312.kim@samsung.com/ Reviewed-by: Andre Przywara Signed-off-by: Seung-Woo Kim --- diff --git a/tools/sunxi_toc0.c b/tools/sunxi_toc0.c index 292649fe90..76693647a0 100644 --- a/tools/sunxi_toc0.c +++ b/tools/sunxi_toc0.c @@ -444,7 +444,7 @@ static int toc0_verify_cert_item(const uint8_t *buf, uint32_t len, RSA *fw_key, /* If a digest was provided, compare it to the embedded digest. */ extension = &totalSequence->mainSequence.explicit3.extension; - if (digest && memcmp(&extension->digest, digest, SHA256_DIGEST_LENGTH)) { + if (memcmp(&extension->digest, digest, SHA256_DIGEST_LENGTH)) { pr_err("Wrong firmware digest in certificate\n"); goto err; }