mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-19 10:35:22 +00:00
If a sample wants to use the Zephyr implementation of mbedtls, it enables CONFIG_MBEDTLS and sets any needed Zephyr-specific mbedtls options. Currently, the LwM2M subsystem selects MBEDTLS automatically when LWM2M_DTLS_SUPPORT is enabled. Let's remove this and let the LwM2M client sample enable mbedtls and it's options. This mimics the behavior of several other network-related samples and removes conflicts when selecting alternate implementations of MBEDTLS. Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/17399 Signed-off-by: Michael Scott <mike@foundries.io>
25 lines
627 B
Plaintext
25 lines
627 B
Plaintext
CONFIG_LWM2M_DTLS_SUPPORT=y
|
|
CONFIG_LWM2M_PEER_PORT=5684
|
|
|
|
# Select Zephyr mbedtls
|
|
CONFIG_MBEDTLS=y
|
|
|
|
# Special MbedTLS changes
|
|
CONFIG_MBEDTLS_ENABLE_HEAP=y
|
|
CONFIG_MBEDTLS_HEAP_SIZE=8192
|
|
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=1500
|
|
CONFIG_MBEDTLS_CIPHER_CCM_ENABLED=y
|
|
|
|
# Disable RSA, we don't parse certs: saves flash/memory
|
|
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_ENABLED=n
|
|
# Enable PSK instead
|
|
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED=y
|
|
|
|
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
|
|
CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=4
|
|
CONFIG_NET_SOCKETS_ENABLE_DTLS=y
|
|
|
|
# MbedTLS needs a larger stack
|
|
CONFIG_MAIN_STACK_SIZE=2048
|
|
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
|