From 3ac38a6b80e16f5885e629b35cb5a36a006ea8a5 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 23 Oct 2025 15:10:30 +0200 Subject: [PATCH] md4: drop mbedtls implementation (not available in mbedtls v3+) Follow-up to 01a2308236ffd4a13a45c3d9850a66a602839af6 #18254 Closes #19202 --- lib/md4.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/lib/md4.c b/lib/md4.c index 5d0908eade..083ecb0d48 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -51,14 +51,6 @@ #endif #endif -#ifdef USE_MBEDTLS -#include -#if MBEDTLS_VERSION_NUMBER < 0x04000000 && defined(MBEDTLS_MD4_C) -#define USE_MBEDTLS_MD4 -#include -#endif -#endif - /* When OpenSSL or wolfSSL is available, we use their MD4 functions. */ #if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4) #include @@ -78,8 +70,6 @@ #include #elif defined(USE_GNUTLS) #include -#elif defined(USE_MBEDTLS_MD4) -#include #endif /* The last 2 #include files should be in this order */ @@ -187,39 +177,6 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) md4_digest(ctx, MD4_DIGEST_SIZE, result); } -#elif defined(USE_MBEDTLS_MD4) - -struct md4_ctx { - void *data; - unsigned long size; -}; -typedef struct md4_ctx MD4_CTX; - -static int MD4_Init(MD4_CTX *ctx) -{ - ctx->data = NULL; - ctx->size = 0; - return 1; -} - -static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size) -{ - if(!ctx->data) { - ctx->data = Curl_memdup(data, size); - if(ctx->data) - ctx->size = size; - } -} - -static void MD4_Final(unsigned char *result, MD4_CTX *ctx) -{ - if(ctx->data) { - mbedtls_md4(ctx->data, ctx->size, result); - Curl_safefree(ctx->data); - ctx->size = 0; - } -} - #else /* When no other crypto library is available, or the crypto library does not * support MD4, we use this code segment this implementation of it