From 67663a02c5ba746254fadb882ff22798c2590d8d Mon Sep 17 00:00:00 2001
From: Frediano Ziglio <freddy77@gmail.com>
Date: Fri, 15 May 2026 22:38:43 +0100
Subject: [PATCH] Fix compatibility with Nettle 4 library

Index: include/freetds/utils/md4.h
--- include/freetds/utils/md4.h.orig
+++ include/freetds/utils/md4.h
@@ -23,6 +23,7 @@ typedef struct MD4Context MD4_CTX;
 #else
 
 #include <nettle/md4.h>
+#include <nettle/version.h>
 
 typedef struct md4_ctx MD4_CTX;
 
@@ -38,7 +39,11 @@ static inline void MD4Update(MD4_CTX *ctx, const uint8
 
 static inline void MD4Final(MD4_CTX *ctx, uint8_t *digest)
 {
+#if defined(NETTLE_VERSION_MAJOR) && NETTLE_VERSION_MAJOR >= 4
+	nettle_md4_digest(ctx, digest);
+#else
 	nettle_md4_digest(ctx, 16, digest);
+#endif
 }
 
 
