aide: Fix compilation with nettle 4.x

Backport unreleased change from upstream to handle building with nettle
4.x now that openembedded-core has upgraded to it.

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
This commit is contained in:
Scott Murray
2026-08-11 20:30:21 +03:00
parent 226839ac40
commit c4c37c0074
2 changed files with 54 additions and 0 deletions
@@ -0,0 +1,53 @@
From 84936cec8ddb7151327563800d752d1d20e39224 Mon Sep 17 00:00:00 2001
From: Hannes von Haugwitz <hannes@vonhaugwitz.com>
Date: Tue, 26 May 2026 21:41:52 +0200
Subject: [PATCH] Support build with nettle 4
* closes: #218
Upstream-Status: Backport [https://github.com/aide/aide/commit/61130addb02a58d7de95d6b8f344ab9b6151d6aa]
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
ChangeLog | 3 +++
src/md.c | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 89905e3..5b3963e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2026-05-26 Hannes von Haugwitz <hannes@vonhaugwitz.com>
+ * Support build with nettle 4 (closes: #218)
+
2026-01-31 Hannes von Haugwitz <hannes@vonhaugwitz.com>
* Release aide 0.19.3
diff --git a/src/md.c b/src/md.c
index e4e66ad..1aec9d9 100644
--- a/src/md.c
+++ b/src/md.c
@@ -47,6 +47,8 @@
#include <nettle/gosthash94.h>
#include <nettle/streebog.h>
+#include <nettle/version.h>
+
typedef struct {
nettle_hash_init_func *init;
nettle_hash_update_func *update;
@@ -166,7 +168,11 @@ int close_md(struct md_container* md, md_hashsums * hs, const char *filename, co
for (HASHSUM i = 0 ; i < num_hashes ; ++i) {
DB_ATTR_TYPE h = ATTR(hashsums[i].attribute);
if (h&md->calc_attr) {
+#if NETTLE_VERSION_MAJOR < 4
nettle_functions[i].digest(&md->ctx[i].md5, hashsums[i].length, hs->hashsums[i]);
+#else
+ nettle_functions[i].digest(&md->ctx[i].md5, hs->hashsums[i]);
+#endif
}
}
#endif
--
2.47.3
+1
View File
@@ -7,6 +7,7 @@ DEPENDS = "bison-native libpcre2"
SRC_URI = "https://github.com/aide/aide/releases/download/v${PV}/${BPN}-${PV}.tar.gz \
file://0001-Fixes-build-issues.patch \
file://0002-Support-build-with-nettle-4.patch \
file://aide.conf \
"