Skip to content

Commit

Permalink
nrf_security: Add support for mbedTLS memory debug
Browse files Browse the repository at this point in the history
This commit enables application to set the CONFIG_MBEDTLS_MEMORY_DEBUG
KConfig and pass it to mbedTLS configuration.

Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
  • Loading branch information
LuDuda authored and nordicjm committed Sep 1, 2023
1 parent 088551b commit 295fd09
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions subsys/nrf_security/Kconfig.tls
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ config MBEDTLS_DEBUG_LEVEL
3 Information
4 Verbose

config MBEDTLS_MEMORY_DEBUG
bool "mbed TLS memory debug activation"
help
Enable debugging of buffer allocator memory issues. Automatically
prints (to stderr) all (fatal) messages on memory allocation
issues. Enables function for 'debug output' of allocated memory.

config MBEDTLS_SSL_PROTO_DTLS
bool "Enable support for DTLS"
depends on MBEDTLS_SSL_PROTO_TLS1_2
Expand Down
1 change: 1 addition & 0 deletions subsys/nrf_security/cmake/legacy_crypto_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ kconfig_check_and_set_base(MBEDTLS_PKCS5_C)
kconfig_check_and_set_base(MBEDTLS_PK_PARSE_C)
kconfig_check_and_set_base(MBEDTLS_PK_WRITE_C)
kconfig_check_and_set_base(MBEDTLS_DEBUG_C)
kconfig_check_and_set_base(MBEDTLS_MEMORY_DEBUG)

kconfig_check_and_set_base(MBEDTLS_PSA_CRYPTO_SPM)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@
*
* Uncomment this macro to let the buffer allocator print out error messages.
*/
//#define MBEDTLS_MEMORY_DEBUG
#cmakedefine MBEDTLS_MEMORY_DEBUG

/**
* \def MBEDTLS_MEMORY_BACKTRACE
Expand Down

0 comments on commit 295fd09

Please sign in to comment.