boot: zephyr: Detect invalid Kconfig'uration earlier

Instead of detecting an invalid Kconfiguration during CMake
Configure-time we detect it where it belongs, in Kconfig.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2019-01-22 13:53:12 +01:00 committed by David Brown
parent b94bda03aa
commit 913a385137
2 changed files with 4 additions and 9 deletions

View File

@ -106,15 +106,6 @@ if(CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256)
target_sources(app PRIVATE "${TINYCRYPT_DIR}/source/sha256.c") target_sources(app PRIVATE "${TINYCRYPT_DIR}/source/sha256.c")
target_sources(app PRIVATE "${TINYCRYPT_DIR}/source/utils.c") target_sources(app PRIVATE "${TINYCRYPT_DIR}/source/utils.c")
# When building for ECDSA, we use our own copy of mbedTLS, so the Zephyr
# one must not be enabled or the MBEDTLS_CONFIG_FILE macros will collide.
if(DEFINED CONFIG_MBEDTLS)
message(FATAL_ERROR "\
CONFIG_MBEDTLS should not be enabled. \
Try adding CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y to your prj.conf, \
delete the build folder and build from scratch.")
endif()
# Since here we are not using Zephyr's mbedTLS but rather our own, we need # Since here we are not using Zephyr's mbedTLS but rather our own, we need
# to set MBEDTLS_CONFIG_FILE ourselves. When using Zephyr's copy, this # to set MBEDTLS_CONFIG_FILE ourselves. When using Zephyr's copy, this
# variable is set by its Kconfig in the Zephyr codebase. # variable is set by its Kconfig in the Zephyr codebase.

View File

@ -36,6 +36,10 @@ config BOOT_USE_TINYCRYPT
bool bool
# Hidden option # Hidden option
default n default n
# When building for ECDSA, we use our own copy of mbedTLS, so the
# Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros
# will collide.
depends on ! MBEDTLS
help help
Use TinyCrypt for crypto primitives. Use TinyCrypt for crypto primitives.