Commit b664a082 authored by Ding Tao's avatar Ding Tao Committed by Fabio Utzig
Browse files

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: default avatarDing Tao <miyatsu@qq.com>
parent b77262e1
Loading
Loading
Loading
Loading
+2 −2
Changes for boot/zephyr/os.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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>

+1 −3
Changes for boot/zephyr/prj-p256.conf: 1 added line, 3 removed lines.
Original line number Diff line number Diff line
@@ -4,9 +4,7 @@ CONFIG_DEBUG=y
CONFIG_SYSTEM_CLOCK_DISABLE=y

CONFIG_MAIN_STACK_SIZE=10240
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=n
CONFIG_MBEDTLS_CFG_FILE="config-asn1.h"
MCUBOOT_MBEDTLS_CFG_FILE="config-asn1.h"
# CONFIG_TINYCRYPT is not set
# CONFIG_TINYCRYPT_ECC_DSA is not set
# CONFIG_TINYCRYPT_SHA256 is not set