Skip to content

Commit c405fc6

Browse files
committed
[nrf fromlist] modules: mbedtls: Expose MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
The commit adds Kconfig options that allows users to select MBEDTLS_PLATFORM_NO_STD_FUNCTIONS configuration options. Currently selecting the CONFIG_MBEDTLS_PLATFORM_NO_STD_FUNCTIONS will enable MBEDTLS_PLATFORM_NO_STD_FUNCTIONS and MBEDTLS_PLATFORM_SNPRINTF_ALT. Upstream PR #: 87135 Signed-off-by: Dominik Ermel <[email protected]>
1 parent 85179a3 commit c405fc6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

modules/mbedtls/Kconfig.tls-generic

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,14 @@ config MBEDTLS_GENPRIME_ENABLED
406406
config MBEDTLS_ASN1_PARSE_C
407407
bool "Support for ASN1 parser functions"
408408

409+
config MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
410+
bool "Use mbedTLS provided standard functions"
411+
help
412+
This replaces, within mbedTLS, usage of functions like alloc, calloc,
413+
free, snprintf, or printf with mbedTLS specific implantations.
414+
This option may be useful if system is compiled in without some
415+
of these functions, as mbedTLS may provide own implementations.
416+
409417
config MBEDTLS_PEM_CERTIFICATE_FORMAT
410418
bool "Support for PEM certificate format"
411419
help

modules/mbedtls/configs/config-tls-generic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#define MBEDTLS_PLATFORM_ZEROIZE_ALT
2424
#endif
2525

26+
#if defined(CONFIG_MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
27+
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
28+
#define MBEDTLS_PLATFORM_SNPRINTF_ALT
29+
#endif
30+
2631
#if defined(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR)
2732
#define MBEDTLS_ENTROPY_HARDWARE_ALT
2833
#else

0 commit comments

Comments
 (0)