summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/sec-common.c
diff options
context:
space:
mode:
authorMadan Srinivas <madans@ti.com>2018-01-09 23:32:41 +0300
committerTom Rini <trini@konsulko.com>2018-01-19 23:49:30 +0300
commitfbd23b9b94e848f715b8b5d34793fadc60190b35 (patch)
tree42e215919601c196787ed1668d89cd4d36695fa9 /arch/arm/mach-omap2/sec-common.c
parent0d8c1df8d8b2cb7b3d5fe900422c727ea15c24a2 (diff)
downloadu-boot-fbd23b9b94e848f715b8b5d34793fadc60190b35.tar.xz
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/sec-common.c')
-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 */