summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorMadan Srinivas <madans@ti.com>2018-01-09 14:32:41 -0600
committerTom Rini <trini@konsulko.com>2018-01-19 15:49:30 -0500
commitfbd23b9b94e848f715b8b5d34793fadc60190b35 (patch)
tree42e215919601c196787ed1668d89cd4d36695fa9 /arch/arm/mach-omap2
parent0d8c1df8d8b2cb7b3d5fe900422c727ea15c24a2 (diff)
arm: am33xx: security: Fix size calculation on header
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 <madans@ti.com> Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/sec-common.c2
1 files changed, 1 insertions, 1 deletions
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 */