imx: hab: Check if CSF is valid before authenticating image
authorUtkarsh Gupta <utkarsh.gupta@nxp.com>
Tue, 20 Feb 2018 01:19:24 +0000 (01:19 +0000)
committerStefano Babic <sbabic@denx.de>
Thu, 22 Feb 2018 13:35:42 +0000 (14:35 +0100)
commited286bc80e9d237dd1732ced037427e7d9a277a0
tree733d66e1d419d0c16cc4f65c676f1d6634391a09
parent8c4037a09a5c2f15aae4c79860a31c8045bd4ee8
imx: hab: Check if CSF is valid before authenticating image

For proper authentication the HAB code must check if the CSF is valid.
Users must call the csf_is_valid() function to parse the CSF prior to
authenticating any additional images. The function will return a failure
if any of the following invalid conditions are met:

- CSF pointer is NULL
- CSF Header does not exist
- CSF does not lie within the image bounds
- CSF command length zero

Signed-off-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
arch/arm/include/asm/mach-imx/hab.h
arch/arm/mach-imx/hab.c