Commit 61cf3b05 authored by Sebastian Bøe's avatar Sebastian Bøe Committed by Anas Nashif
Browse files

mbedtls: Kconfig: Re-organize to enable choosing an mbedtls impl.



CONFIG_MBEDTLS means you are using MBEDTLS
CONFIG_MBEDTLS_BUILTIN means you are using a built-in MDEDTLS
CONFIG_MBEDTLS_LIBRARY means you are using an external MBEDTLS

This patch ensures that you must select one or the other
implementation when MBEDTLS is enabled.

Tested by opening xconfig and observing that when MBEDTLS was enabled,
BUILTIN was automatically enabled, and a radio-button interface
existed to change the implementation.

Signed-off-by: default avatarSebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: default avatarDing Tao <miyatsu@qq.com>
parent c968a85d
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -24,13 +24,24 @@ menuconfig MBEDTLS
	help
	  This option enables the mbedTLS cryptography library.

if MBEDTLS

choice
	prompt "Select implementation"
	default MBEDTLS_BUILTIN

config MBEDTLS_BUILTIN
	bool "Enable mbedTLS integrated sources"
	depends on MBEDTLS
	default n
	help
	  Link with local mbedTLS sources instead of external library.

config MBEDTLS_LIBRARY
	bool "Enable mbedTLS external library"
	help
	This option enables mbedTLS library.

endchoice

config MBEDTLS_CFG_FILE
	string "mbed TLS configuration file"
	depends on MBEDTLS_BUILTIN
@@ -59,13 +70,6 @@ config MBEDTLS_TEST
	help
	  Enable self test function for the crypto algorithms

config MBEDTLS_LIBRARY
	bool "Enable mbedTLS external library"
	depends on MBEDTLS
	default n
	help
	  This option enables mbedTLS library.

config MBEDTLS_INSTALL_PATH
	string "mbedTLS install path"
	depends on MBEDTLS_LIBRARY
@@ -77,7 +81,6 @@ config MBEDTLS_INSTALL_PATH
config MBEDTLS_ENABLE_HEAP
	bool "Enable global heap for mbed TLS"
	default n
	depends on MBEDTLS
	help
	  This option enables the mbedtls to use the heap. This setting must
	  be global so that various applications and libraries in Zephyr do not
@@ -107,3 +110,5 @@ config APP_LINK_WITH_MBEDTLS
	  Add MBEDTLS header files to the 'app' include path. It may be
	  disabled if the include paths for MBEDTLS are causing aliasing
	  issues for 'app'.

endif