modules: mbedtls: Expose MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
The commit adds Kconfig options that allows users to select - MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - MBEDTLS_PLATFORM_SNPRINTF_ALT allowing Mbed TLS to use alternative definitions of STD functions. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
parent
d7e363e358
commit
350a223321
2 changed files with 30 additions and 0 deletions
|
@ -378,6 +378,28 @@ config MBEDTLS_GENPRIME_ENABLED
|
||||||
config MBEDTLS_ASN1_PARSE_C
|
config MBEDTLS_ASN1_PARSE_C
|
||||||
bool "Support for ASN1 parser functions"
|
bool "Support for ASN1 parser functions"
|
||||||
|
|
||||||
|
config MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
||||||
|
bool "Remove usage of standard libc functions"
|
||||||
|
help
|
||||||
|
This prevents Mbed TLS from linking against the following standard functions
|
||||||
|
from libc: `snprintf`, `vsnprintf`, `printf`, `fprintf`, `calloc`, `free`, `setbuf`, `exit`
|
||||||
|
and `time`. By default Mbed TLS will use stub functions for all these functions.
|
||||||
|
These stubs are just meant to return successfully, but they don't implement
|
||||||
|
the required functionality.
|
||||||
|
Users can individually override each of these stubs by calling
|
||||||
|
`mbedtls_platform_set_xxx()` to set the their implementation of `xxx()` function
|
||||||
|
at runtime.
|
||||||
|
|
||||||
|
if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
||||||
|
|
||||||
|
config MBEDTLS_PLATFORM_SNPRINTF_ALT
|
||||||
|
bool "Allow setting custom snprintf at run-time"
|
||||||
|
help
|
||||||
|
Allow setting a custom `snprintf()` function with `mbedtls_platform_set_snprintf()`.
|
||||||
|
Include `mbedtls/platform.h` for the prototype of this function.
|
||||||
|
|
||||||
|
endif # MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
||||||
|
|
||||||
config MBEDTLS_PEM_CERTIFICATE_FORMAT
|
config MBEDTLS_PEM_CERTIFICATE_FORMAT
|
||||||
bool "Support for PEM certificate format"
|
bool "Support for PEM certificate format"
|
||||||
help
|
help
|
||||||
|
|
|
@ -23,6 +23,14 @@
|
||||||
#define MBEDTLS_PLATFORM_ZEROIZE_ALT
|
#define MBEDTLS_PLATFORM_ZEROIZE_ALT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
|
||||||
|
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
||||||
|
#endif /* defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) */
|
||||||
|
|
||||||
|
#if defined(CONFIG_MBEDTLS_PLATFORM_SNPRINTF_ALT)
|
||||||
|
#define MBEDTLS_PLATFORM_SNPRINTF_ALT
|
||||||
|
#endif /* defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) */
|
||||||
|
|
||||||
#if defined(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR)
|
#if defined(CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR)
|
||||||
#define MBEDTLS_ENTROPY_HARDWARE_ALT
|
#define MBEDTLS_ENTROPY_HARDWARE_ALT
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue