mbedtls icon indicating copy to clipboard operation
mbedtls copied to clipboard

Fixed compilation on windows when MBEDTLS_HAVE_TIME is disabled but MBEDTLS_FS_IO is enabled

Open Cryru opened this issue 9 months ago • 3 comments

x509_crt does not compile when the MBEDTLS_HAVE_TIME option is disabled and the MBEDTLS_FS_IO is enabled because the windows.h header isn't included and MAX_PATH and other symbols (usage: mbedtls_x509_crt_parse_path) cannot be found.

Cryru avatar Apr 10 '25 07:04 Cryru

In case of failure it makes sense to provide the complete environment information: library version or commit, configuration, compiler.

It seems my tests with the current development head were not clean enough, because winsock2.h had been already added into one of the build_info.h files as a part of preparation for a different PR. With this change your patch would not be needed, though might make sense for backporting.

irwir avatar Apr 11 '25 16:04 irwir

Thanks for this, it seems that we indeed miss in x509_crt.c the inclusion of windows.h when MBEDTLS_FS_IO is enabled and MBEDTLS_HAVE_TIME disabled.

ronald-cron-arm avatar Apr 16 '25 14:04 ronald-cron-arm

Added the requested changes and DCO.

Cryru avatar Apr 17 '25 05:04 Cryru