zephyr/Kconfig: fix deadlock on cryptolib selectors

If user generate project and the will try to switch signature type
then it is very likely that MBETLS will be enabled simultaneously when
tinycrypt has to be force-selected, which causes kconfig warning on
impossible configuration. Such configuration won't be possible to be
fixed using menuconfig etc.

This patch moves dependency check on !MBEDTLS from kconfig to preprocessor
which makes manual fixing using menuconfig possible.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
Andrzej Puzdrowski 2021-07-23 15:22:27 +02:00
parent 506a16f085
commit 5cf941013f
2 changed files with 8 additions and 2 deletions

View File

@ -30,7 +30,6 @@ config BOOT_USE_TINYCRYPT
# When building for ECDSA, we use our own copy of mbedTLS, so the # 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 # Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros
# will collide. # will collide.
depends on ! MBEDTLS
help help
Use TinyCrypt for crypto primitives. Use TinyCrypt for crypto primitives.
@ -41,7 +40,6 @@ config BOOT_USE_CC310
# When building for ECDSA, we use our own copy of mbedTLS, so the # 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 # Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros
# will collide. # will collide.
depends on ! MBEDTLS
help help
Use cc310 for crypto primitives. Use cc310 for crypto primitives.

View File

@ -34,6 +34,14 @@
#define MCUBOOT_SIGN_ED25519 #define MCUBOOT_SIGN_ED25519
#endif #endif
#if defined(CONFIG_BOOT_USE_TINYCRYPT)
# if defined(CONFIG_MBEDTLS) || defined(CONFIG_BOOT_USE_CC310)
# error "One crypto library implementation allowed at a time."
# endif
#elif defined(CONFIG_MBEDTLS) && defined(CONFIG_BOOT_USE_CC310)
# error "One crypto library implementation allowed at a time."
#endif
#ifdef CONFIG_BOOT_USE_MBEDTLS #ifdef CONFIG_BOOT_USE_MBEDTLS
#define MCUBOOT_USE_MBED_TLS #define MCUBOOT_USE_MBED_TLS
#elif defined(CONFIG_BOOT_USE_TINYCRYPT) #elif defined(CONFIG_BOOT_USE_TINYCRYPT)