From 20ab1e807df6d2cd031c75f57271e2fb5e022a93 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 22 Aug 2024 17:43:17 +0530 Subject: [PATCH] fix(mbedtls): Fix the MBEDTLS_FS_IO dependency on vfs By default MBEDTLS_FS_IO option in mbedtls uses the filesystem supported added by vfs component. If the vfs support is disabled by user then mbedtls raises a warning that the filesystem realted operation shall always fail This commit fixes the behaviour by enabling respective depedency check for the MBEDTLS_FS_IO option Closes https://github.com/espressif/esp-idf/issues/14409 --- components/mbedtls/Kconfig | 10 ++++++++++ components/mbedtls/port/include/mbedtls/esp_config.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/components/mbedtls/Kconfig b/components/mbedtls/Kconfig index 87bb4a1c15..17718a5299 100644 --- a/components/mbedtls/Kconfig +++ b/components/mbedtls/Kconfig @@ -1175,4 +1175,14 @@ menu "mbedTLS" the flash footprint and hence care must be taken to keep some reserved space for the application binary in flash layout. + config MBEDTLS_FS_IO + bool "Enable functions that use the filesystem" + default y + depends on (VFS_SUPPORT_IO && VFS_SUPPORT_DIR) || IDF_TARGET_LINUX + help + This option enables functions in mbedTLS that use the filesystem. + It uses the default filesystem support for the target, + which is added through vfs component for ESP32 based targets or by + the host system when the target is Linux. + endmenu # mbedTLS diff --git a/components/mbedtls/port/include/mbedtls/esp_config.h b/components/mbedtls/port/include/mbedtls/esp_config.h index 376b636d92..d913d28e6f 100644 --- a/components/mbedtls/port/include/mbedtls/esp_config.h +++ b/components/mbedtls/port/include/mbedtls/esp_config.h @@ -872,7 +872,13 @@ * * Enable functions that use the filesystem. */ +#if CONFIG_MBEDTLS_FS_IO #define MBEDTLS_FS_IO +#else +#undef MBEDTLS_FS_IO +#undef MBEDTLS_PSA_ITS_FILE_C +#undef MBEDTLS_PSA_CRYPTO_STORAGE_C +#endif #ifndef CONFIG_IDF_TARGET_LINUX /**