From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew F. Davis Date: Tue, 9 Jan 2018 14:32:41 -0600 Subject: [U-Boot] [PATCH] arm: am33xx: security: Fix size calculation on header Message-ID: <20180109203241.5777-1-afd@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Madan Srinivas Fix the size calculation in the verify boot. The header size should be subtracted from the image size, not be assigned to the image size. Fixes: 0830d72bb9f8 ("arm: am33xx: security: adds auth support for encrypted images") Signed-off-by: Madan Srinivas Signed-off-by: Dan Murphy Signed-off-by: Andrew F. Davis --- arch/arm/mach-omap2/sec-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/sec-common.c b/arch/arm/mach-omap2/sec-common.c index 2630e7d316..674517e30b 100644 --- a/arch/arm/mach-omap2/sec-common.c +++ b/arch/arm/mach-omap2/sec-common.c @@ -130,7 +130,7 @@ int secure_boot_verify_image(void **image, size_t *size) *size = sig_addr - cert_addr; /* Subtract out the signature size */ /* Subtract header if present */ if (strncmp((char *)sig_addr, "CERT_ISW_", 9) == 0) - *size = ((u32 *)*image)[HEADER_SIZE_OFFSET]; + *size -= ((u32 *)*image)[HEADER_SIZE_OFFSET]; cert_size = *size; /* Check if image load address is 32-bit aligned */ -- 2.15.1