zephyr: mbedtls: Fix compile error no such file or directory
Upstream zephyr will automatically link mbedtls when CONFIG_MBEDTLS is
enabled.
If user chose to use ECDSA_P256 as signature type, will get a compile
error message in file ${ZEPHYR_BASE}/ext/lib/crypto/mbedtls/zephyr_init.c:
fatal error: config-asn1.h: No such file or directory
Fix this by disable CONFIG_MBEDTLS when ECDSA_P256 signature type is
selected.
Signed-off-by: Ding Tao <miyatsu@qq.com>
diff --git a/boot/zephyr/os.c b/boot/zephyr/os.c
index f913268..7c24eb3 100644
--- a/boot/zephyr/os.c
+++ b/boot/zephyr/os.c
@@ -22,9 +22,9 @@
#include "os/os_heap.h"
-#ifdef MCUBOOT_USE_MBED_TLS
+#if !defined(CONFIG_MBEDTLS) && defined(MCUBOOT_USE_MBED_TLS)
-#define MBEDTLS_CONFIG_FILE CONFIG_MBEDTLS_CFG_FILE
+#define MBEDTLS_CONFIG_FILE MCUBOOT_MBEDTLS_CFG_FILE
#include <mbedtls/platform.h>
#include <mbedtls/memory_buffer_alloc.h>