mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
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:
parent
357e6cfd57
commit
01a2308236
8 changed files with 38 additions and 178 deletions
21
lib/md5.c
21
lib/md5.c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue