From 214608ae877b6bf125da76bdbcf5a2a0b0918568 Mon Sep 17 00:00:00 2001 From: Wilfred Mallawa Date: Thu, 25 Jan 2024 13:21:54 +1000 Subject: [PATCH] os_stub: mbedtlslib: allow skipping time checks This allows the user to compile libspdm with -DCMAKE_C_FLAGS="-DMBEDTLS_SKIP_TIME_CHECK" for a target that does not support the time()/gmtime() functions in time.h. Signed-off-by: Wilfred Mallawa --- os_stub/mbedtlslib/include/mbedtls/config.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os_stub/mbedtlslib/include/mbedtls/config.h b/os_stub/mbedtlslib/include/mbedtls/config.h index 82507ea4773..b121546c8a7 100644 --- a/os_stub/mbedtlslib/include/mbedtls/config.h +++ b/os_stub/mbedtlslib/include/mbedtls/config.h @@ -140,7 +140,9 @@ * * Comment if your system does not support time functions */ +#ifndef MBEDTLS_SKIP_TIME_CHECK #define MBEDTLS_HAVE_TIME +#endif /** * \def MBEDTLS_HAVE_TIME_DATE @@ -161,7 +163,9 @@ * mbedtls_platform_gmtime_r() at compile-time by using the macro * MBEDTLS_PLATFORM_GMTIME_R_ALT. */ +#ifndef MBEDTLS_SKIP_TIME_CHECK #define MBEDTLS_HAVE_TIME_DATE +#endif /** * \def MBEDTLS_PLATFORM_MEMORY