Message ID | 1480260463-1517-1-git-send-email-eric@nelint.com |
---|---|
State | Deferred |
Delegated to: | Tom Rini |
Headers | show |
Hi all, On 11/27/2016 08:27 AM, Eric Nelson wrote: > The authenticate_image routine returns a boolean to indicate > a valid (1) or invalid (0) image. > An off-list discussion highlighted that the expected return value from the authenticate_image() routine isn't obvious since there isn't any user in main-line except the "hab_auth_img" command. My understanding was gleaned from this use in the NXP tree: http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/drivers/usb/gadget/f_fastboot.c?id=m6.0.1_2.1.0-ga#n1727
diff --git a/arch/arm/imx-common/hab.c b/arch/arm/imx-common/hab.c index 6731825..e2c04f9 100644 --- a/arch/arm/imx-common/hab.c +++ b/arch/arm/imx-common/hab.c @@ -486,7 +486,9 @@ static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc, rcode = authenticate_image(addr, ivt_offset); - return rcode; + return (rcode != 0) + ? CMD_RET_SUCCESS + : CMD_RET_FAILURE; } U_BOOT_CMD(