Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: Add generation of MBEDTLS_HAVE_TIME and MBEDTLS_HAVE_TIME_DATE #20130

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions subsys/nrf_security/Kconfig.legacy
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ config MBEDTLS_MPI_MAX_SIZE
default 384 if CC312_BACKEND
range 256 2048

config MBEDTLS_HAVE_TIME
bool
default y
depends on DATE_TIME

config MBEDTLS_HAVE_TIME_DATE
bool
default y
depends on DATE_TIME

config MBEDTLS_LEGACY_CRYPTO_C_SILENCE_DEPRECATION
bool
help
Expand Down
2 changes: 2 additions & 0 deletions subsys/nrf_security/cmake/legacy_crypto_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ kconfig_check_and_set_base(MBEDTLS_CIPHER_PADDING_PKCS7)
kconfig_check_and_set_base(MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS)
kconfig_check_and_set_base(MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN)
kconfig_check_and_set_base(MBEDTLS_CIPHER_PADDING_ZEROS)
kconfig_check_and_set_base(MBEDTLS_HAVE_TIME)
kconfig_check_and_set_base(MBEDTLS_HAVE_TIME_DATE)

kconfig_check_and_set_base(MBEDTLS_AES_FEWER_TABLES)
kconfig_check_and_set_base(MBEDTLS_AES_ROM_TABLES)
Expand Down
2 changes: 2 additions & 0 deletions subsys/nrf_security/cmake/nrf_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ kconfig_check_and_set_base(MBEDTLS_NO_PLATFORM_ENTROPY)
kconfig_check_and_set_base(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
kconfig_check_and_set_base(MBEDTLS_DEBUG_C)
kconfig_check_and_set_base_to_one(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
kconfig_check_and_set_base(MBEDTLS_HAVE_TIME)
kconfig_check_and_set_base(MBEDTLS_HAVE_TIME_DATE)

# Threading configurations for CryptoCell and locally built PSA core
kconfig_check_and_set_base(MBEDTLS_THREADING_C)
Expand Down
4 changes: 2 additions & 2 deletions subsys/nrf_security/configs/legacy_crypto_config.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
*
* Comment if your system does not support time functions
*/
//#define MBEDTLS_HAVE_TIME
#cmakedefine MBEDTLS_HAVE_TIME

/**
* \def MBEDTLS_HAVE_TIME_DATE
Expand All @@ -146,7 +146,7 @@
* mbedtls_platform_gmtime_r() at compile-time by using the macro
* MBEDTLS_PLATFORM_GMTIME_R_ALT.
*/
//#define MBEDTLS_HAVE_TIME_DATE
#cmakedefine MBEDTLS_HAVE_TIME_DATE

/**
* \def MBEDTLS_PLATFORM_MEMORY
Expand Down
2 changes: 2 additions & 0 deletions subsys/nrf_security/configs/nrf-config.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#cmakedefine MBEDTLS_MEMORY_BUFFER_ALLOC_C
#cmakedefine MBEDTLS_DEBUG_C
#cmakedefine MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
#cmakedefine MBEDTLS_HAVE_TIME
#cmakedefine MBEDTLS_HAVE_TIME_DATE

/* Platform configurations for _ALT defines */
#cmakedefine MBEDTLS_PLATFORM_EXIT_ALT
Expand Down