]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
md4: drop mbedtls implementation (not available in mbedtls v3+)
authorViktor Szakats <commit@vsz.me>
Thu, 23 Oct 2025 13:10:30 +0000 (15:10 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 23 Oct 2025 14:47:19 +0000 (16:47 +0200)
Follow-up to 01a2308236ffd4a13a45c3d9850a66a602839af6 #18254

Closes #19202

lib/md4.c

index 5d0908eadefa94a5f36cc3f0f0646fa6d1b9008e..083ecb0d48f265c1c58efe935f496d617db2e90f 100644 (file)
--- a/lib/md4.c
+++ b/lib/md4.c
 #endif
 #endif
 
-#ifdef USE_MBEDTLS
-#include <mbedtls/version.h>
-#if MBEDTLS_VERSION_NUMBER < 0x04000000 && defined(MBEDTLS_MD4_C)
-#define USE_MBEDTLS_MD4
-#include <mbedtls/mbedtls_config.h>
-#endif
-#endif
-
 /* When OpenSSL or wolfSSL is available, we use their MD4 functions. */
 #if defined(USE_WOLFSSL) && !defined(WOLFSSL_NO_MD4)
 #include <wolfssl/openssl/md4.h>
@@ -78,8 +70,6 @@
 #include <wincrypt.h>
 #elif defined(USE_GNUTLS)
 #include <nettle/md4.h>
-#elif defined(USE_MBEDTLS_MD4)
-#include <mbedtls/md4.h>
 #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