]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
dsa-fips: omit digest_size argument for sha384_digest with Nettle 4
authorDaiki Ueno <ueno@gnu.org>
Wed, 25 Feb 2026 23:19:52 +0000 (08:19 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 27 Feb 2026 23:37:42 +0000 (08:37 +0900)
Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/nettle/int/dsa-fips.h

index 5c1c90e3ba9a29140c95f99543313d2b3d6eaea4..e0e80c5517bc62a112afa69bcbf1e80a820b9638 100644 (file)
@@ -25,6 +25,7 @@
 #include <nettle/bignum.h> /* includes gmp.h */
 #include <nettle/dsa.h>
 #include <nettle/sha2.h>
+#include <nettle/version.h>
 #include "fips.h"
 
 #define div_ceil(x, y) ((x + (y) - 1) / (y))
@@ -100,7 +101,11 @@ inline static void hash(uint8_t digest[DIGEST_SIZE], unsigned length,
 
        sha384_init(&ctx);
        sha384_update(&ctx, length, data);
+#if NETTLE_VERSION_MAJOR >= 4
+       sha384_digest(&ctx, digest);
+#else
        sha384_digest(&ctx, DIGEST_SIZE, digest);
+#endif
 
        return;
 }