Skip to content

Commit af7c24b

Browse files
committed
zephyr: Call bootutil_crypto_backend_init in main
Initialize crypto backend. Signed-off-by: Dominik Ermel <[email protected]>
1 parent c1138f0 commit af7c24b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

boot/zephyr/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "bootutil/boot_hooks.h"
4747
#include "bootutil/fault_injection_hardening.h"
4848
#include "bootutil/mcuboot_status.h"
49+
#include "bootutil/crypto/backend.h"
4950
#include "flash_map_backend/flash_map_backend.h"
5051

5152
#if defined(CONFIG_MCUBOOT_UUID_VID) || defined(CONFIG_MCUBOOT_UUID_CID)
@@ -496,6 +497,7 @@ static void boot_serial_enter()
496497

497498
int main(void)
498499
{
500+
bool crypto_ok;
499501
struct boot_rsp rsp;
500502
int rc;
501503
#if defined(CONFIG_BOOT_USB_DFU_GPIO) || defined(CONFIG_BOOT_USB_DFU_WAIT)
@@ -512,6 +514,12 @@ int main(void)
512514
BOOT_LOG_INF("Starting Direct-XIP bootloader");
513515
#endif
514516

517+
crypto_ok = bootutil_crypto_backend_init();
518+
if (!crypto_ok) {
519+
BOOT_LOG_ERR("Failed to initialize crypto backend");
520+
FIH_PANIC;
521+
}
522+
515523
#ifdef CONFIG_MCUBOOT_INDICATION_LED
516524
/* LED init */
517525
io_led_init();

0 commit comments

Comments
 (0)