diff options
author | Ye Li | 2021-03-25 17:30:06 +0800 |
---|---|---|
committer | Stefano Babic | 2021-04-08 09:18:29 +0200 |
commit | c428ca80c298df55db242571d868dae7b475ccb5 (patch) | |
tree | 849e573fdac9c6ea89a56edb7c80f3ced0aae03d /arch | |
parent | 55086e196eaca9403a636ea7079e7135bddbbece (diff) |
imx: hab: Add function to authenticate kernel image
When loading kernel image, the image size is parsed from header, so it
does not include the CSF and IVT.
Add back the authenticate_image function to wrap the imx_hab_authenticate_image
with calculating IVT offset and full image size.
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/hab.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index d0757d8b66a..66ac4403496 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -698,3 +698,15 @@ hab_authentication_exit: return result; } + +int authenticate_image(u32 ddr_start, u32 raw_image_size) +{ + u32 ivt_offset; + size_t bytes; + + ivt_offset = (raw_image_size + ALIGN_SIZE - 1) & + ~(ALIGN_SIZE - 1); + bytes = ivt_offset + IVT_SIZE + CSF_PAD_SIZE; + + return imx_hab_authenticate_image(ddr_start, bytes, ivt_offset); +} |