diff --git a/components/mbedtls/Kconfig b/components/mbedtls/Kconfig index dab6dbd13f..b7534c380b 100644 --- a/components/mbedtls/Kconfig +++ b/components/mbedtls/Kconfig @@ -1160,4 +1160,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 5b0bf25c38..115a0a4178 100644 --- a/components/mbedtls/port/include/mbedtls/esp_config.h +++ b/components/mbedtls/port/include/mbedtls/esp_config.h @@ -870,7 +870,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 /** * \def MBEDTLS_NO_PLATFORM_ENTROPY