mbedtls: bump minimum version required to 3.2.0

3.2.0 was released on July 11, 2022.

Ref: #18161
Closes #18254
This commit is contained in:
Viktor Szakats 2025-08-11 18:31:30 +02:00
parent 357e6cfd57
commit 01a2308236
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
8 changed files with 38 additions and 178 deletions

View file

@ -36,10 +36,8 @@
#ifdef USE_MBEDTLS
#include <mbedtls/version.h>
#if(MBEDTLS_VERSION_NUMBER >= 0x02070000) && \
(MBEDTLS_VERSION_NUMBER < 0x03000000)
#define HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS
#if MBEDTLS_VERSION_NUMBER < 0x03020000
#error "mbedTLS 3.2.0 or later required"
#endif
#endif /* USE_MBEDTLS */
@ -161,15 +159,8 @@ typedef mbedtls_md5_context my_md5_ctx;
static CURLcode my_md5_init(void *ctx)
{
#if (MBEDTLS_VERSION_NUMBER >= 0x03000000)
if(mbedtls_md5_starts(ctx))
return CURLE_OUT_OF_MEMORY;
#elif defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS)
if(mbedtls_md5_starts_ret(ctx))
return CURLE_OUT_OF_MEMORY;
#else
(void)mbedtls_md5_starts(ctx);
#endif
return CURLE_OK;
}
@ -177,20 +168,12 @@ static void my_md5_update(void *ctx,
const unsigned char *data,
unsigned int length)
{
#ifndef HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS
(void)mbedtls_md5_update(ctx, data, length);
#else
(void)mbedtls_md5_update_ret(ctx, data, length);
#endif
}
static void my_md5_final(unsigned char *digest, void *ctx)
{
#ifndef HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS
(void)mbedtls_md5_finish(ctx, digest);
#else
(void)mbedtls_md5_finish_ret(ctx, digest);
#endif
}
#elif defined(AN_APPLE_OS)