From fedbc0497bb0407fc1d55430eae1938712f1afe8 Mon Sep 17 00:00:00 2001 From: Juan Castillo Date: Mon, 17 Aug 2015 10:43:27 +0100 Subject: TBB: abort boot if BL3-2 cannot be authenticated BL3-2 image (Secure Payload) is optional. If the image cannot be loaded a warning message is printed and the boot process continues. According to the TBBR document, this behaviour should not apply in case of an authentication error, where the boot process should be aborted. This patch modifies the load_auth_image() function to distinguish between a load error and an authentication error. The caller uses the return value to abort the boot process or continue. In case of authentication error, the memory region used to store the image is wiped clean. Change-Id: I534391d526d514b2a85981c3dda00de67e0e7992 --- bl2/bl2_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bl2/bl2_main.c') diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c index 4c1900252..71940a62c 100644 --- a/bl2/bl2_main.c +++ b/bl2/bl2_main.c @@ -238,8 +238,14 @@ void bl2_main(void) } e = load_bl32(bl2_to_bl31_params); - if (e) - WARN("Failed to load BL3-2 (%i)\n", e); + if (e) { + if (e == LOAD_AUTH_ERR) { + ERROR("Failed to authenticate BL3-2\n"); + panic(); + } else { + WARN("Failed to load BL3-2 (%i)\n", e); + } + } e = load_bl33(bl2_to_bl31_params); if (e) { -- cgit v1.2.3