From 804ed172ddebe0eb216c41c345976b6203c94683 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Wed, 11 Oct 2023 13:41:37 +0530 Subject: [PATCH] fix(mbedtls): allow to use built in entropy implementation for linux target --- components/mbedtls/CMakeLists.txt | 6 ++++-- components/mbedtls/port/include/mbedtls/esp_config.h | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index 0726b0da97..3d2ad9d855 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -192,8 +192,10 @@ if(AES_PERIPHERAL_TYPE STREQUAL "dma") endif() -target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/esp_hardware.c" - "${COMPONENT_DIR}/port/esp_mem.c" +if(NOT ${IDF_TARGET} STREQUAL "linux") + target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/esp_hardware.c") +endif() +target_sources(mbedcrypto PRIVATE "${COMPONENT_DIR}/port/esp_mem.c" "${COMPONENT_DIR}/port/esp_timing.c" ) diff --git a/components/mbedtls/port/include/mbedtls/esp_config.h b/components/mbedtls/port/include/mbedtls/esp_config.h index 9aebf99e29..0bf4d3e603 100644 --- a/components/mbedtls/port/include/mbedtls/esp_config.h +++ b/components/mbedtls/port/include/mbedtls/esp_config.h @@ -232,6 +232,7 @@ #undef MBEDTLS_ECP_VERIFY_ALT_SOFT_FALLBACK #endif +#ifndef CONFIG_IDF_TARGET_LINUX /** * \def MBEDTLS_ENTROPY_HARDWARE_ALT * @@ -244,6 +245,7 @@ * Uncomment to use your own hardware entropy collector. */ #define MBEDTLS_ENTROPY_HARDWARE_ALT +#endif // !CONFIG_IDF_TARGET_LINUX /** * \def MBEDTLS_AES_ROM_TABLES @@ -866,6 +868,7 @@ */ #define MBEDTLS_FS_IO +#ifndef CONFIG_IDF_TARGET_LINUX /** * \def MBEDTLS_NO_PLATFORM_ENTROPY * @@ -876,6 +879,7 @@ * Uncomment this macro to disable the built-in platform entropy functions. */ #define MBEDTLS_NO_PLATFORM_ENTROPY +#endif // !CONFIG_IDF_TARGET_LINUX /** * \def MBEDTLS_PK_RSA_ALT_SUPPORT