From 80e74bd38482150878085d5fd23ab6ef3fef627d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 11 Aug 2025 19:19:43 +0200 Subject: [PATCH] md5 --- lib/md5.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/lib/md5.c b/lib/md5.c index fea20377fe..ff6e155a4d 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -36,10 +36,8 @@ #ifdef USE_MBEDTLS #include - -#if(MBEDTLS_VERSION_NUMBER >= 0x02070000) && \ - (MBEDTLS_VERSION_NUMBER < 0x03000000) - #define HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS +#if MBEDTLS_VERSION_NUMBER < 0x03000000 + #error "mbedTLS 3.0.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)