Skip to content

Commit 61cf3b0

Browse files
SebastianBoeAnas Nashif
authored andcommitted
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: Sebastian Bøe <[email protected]> Signed-off-by: Ding Tao <[email protected]>
1 parent c968a85 commit 61cf3b0

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

ext/lib/crypto/mbedtls/Kconfig

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,24 @@ menuconfig MBEDTLS
2424
help
2525
This option enables the mbedTLS cryptography library.
2626

27+
if MBEDTLS
28+
29+
choice
30+
prompt "Select implementation"
31+
default MBEDTLS_BUILTIN
32+
2733
config MBEDTLS_BUILTIN
2834
bool "Enable mbedTLS integrated sources"
29-
depends on MBEDTLS
30-
default n
3135
help
3236
Link with local mbedTLS sources instead of external library.
3337

38+
config MBEDTLS_LIBRARY
39+
bool "Enable mbedTLS external library"
40+
help
41+
This option enables mbedTLS library.
42+
43+
endchoice
44+
3445
config MBEDTLS_CFG_FILE
3546
string "mbed TLS configuration file"
3647
depends on MBEDTLS_BUILTIN
@@ -59,13 +70,6 @@ config MBEDTLS_TEST
5970
help
6071
Enable self test function for the crypto algorithms
6172

62-
config MBEDTLS_LIBRARY
63-
bool "Enable mbedTLS external library"
64-
depends on MBEDTLS
65-
default n
66-
help
67-
This option enables mbedTLS library.
68-
6973
config MBEDTLS_INSTALL_PATH
7074
string "mbedTLS install path"
7175
depends on MBEDTLS_LIBRARY
@@ -77,7 +81,6 @@ config MBEDTLS_INSTALL_PATH
7781
config MBEDTLS_ENABLE_HEAP
7882
bool "Enable global heap for mbed TLS"
7983
default n
80-
depends on MBEDTLS
8184
help
8285
This option enables the mbedtls to use the heap. This setting must
8386
be global so that various applications and libraries in Zephyr do not
@@ -107,3 +110,5 @@ config APP_LINK_WITH_MBEDTLS
107110
Add MBEDTLS header files to the 'app' include path. It may be
108111
disabled if the include paths for MBEDTLS are causing aliasing
109112
issues for 'app'.
113+
114+
endif

0 commit comments

Comments
 (0)