On 13/8/26 09:40, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
sha.h has been deprecated. It seems we could just rely on sha1.h/sha2.h
for older versions too, but I didn't check.
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4184
Signed-off-by: Marc-André Lureau <[email protected]>
---
crypto/hash-nettle.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/crypto/hash-nettle.c b/crypto/hash-nettle.c
index 53f68301efb5..c0ebb44e11f0 100644
--- a/crypto/hash-nettle.c
+++ b/crypto/hash-nettle.c
@@ -23,8 +23,14 @@
#include "qapi/error.h"
#include "crypto/hash.h"
#include "hashpriv.h"
+#include <nettle/version.h>
#include <nettle/md5.h>
+#if NETTLE_VERSION_MAJOR >= 4
+#include <nettle/sha1.h>
+#include <nettle/sha2.h>
+#else
#include <nettle/sha.h>
+#endif
#include <nettle/ripemd160.h>
#ifdef CONFIG_CRYPTO_SM3
#include <nettle/sm3.h>