aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLionel Debieve <lionel.debieve@st.com>2019-09-03 12:22:23 +0200
committerLionel Debieve <lionel.debieve@st.com>2019-09-23 09:48:07 +0000
commit4bdb1a7a6a1325343b0f0c375b43e9b874e31fca (patch)
treeaf4502cef222e473172193ee4889cb227538c89d /drivers
parentf700423c1f2426ca3c5ccb9ee4e765743424b074 (diff)
downloadtrusted-firmware-a-4bdb1a7a6a1325343b0f0c375b43e9b874e31fca.tar.gz
stm32mp1: add authentication support for stm32image
This commit adds authentication binary support for STM32MP1. It prints the bootrom authentication result if signed image is used and authenticates the next loaded STM32 images. It also enables the dynamic translation table support (PLAT_XLAT_TABLES_DYNAMIC) to use bootrom services. Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Change-Id: Iba706519e0dc6b6fae1f3dd498383351f0f75f51
Diffstat (limited to 'drivers')
-rw-r--r--drivers/st/io/io_stm32image.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/st/io/io_stm32image.c b/drivers/st/io/io_stm32image.c
index 971dcce533..413521b1e9 100644
--- a/drivers/st/io/io_stm32image.c
+++ b/drivers/st/io/io_stm32image.c
@@ -246,7 +246,7 @@ static int stm32image_partition_size(io_entity_t *entity, size_t *length)
static int stm32image_partition_read(io_entity_t *entity, uintptr_t buffer,
size_t length, size_t *length_read)
{
- int result = 0;
+ int result;
uint8_t *local_buffer = (uint8_t *)buffer;
boot_api_image_header_t *header =
(boot_api_image_header_t *)first_lba_buffer;
@@ -341,6 +341,12 @@ static int stm32image_partition_read(io_entity_t *entity, uintptr_t buffer,
header->magic = 0;
}
+ result = stm32mp_auth_image(header, buffer);
+ if (result != 0) {
+ ERROR("Authentication Failed (%i)\n", result);
+ return result;
+ }
+
io_close(backend_handle);
}