* [PATCH] crypto: fix build against nettle >= 4
@ 2026-08-13 7:40 marcandre.lureau
2026-08-13 8:25 ` Philippe Mathieu-Daudé
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: marcandre.lureau @ 2026-08-13 7:40 UTC (permalink / raw)
To: qemu-devel; +Cc: berrange, Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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 <marcandre.lureau@redhat.com>
---
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>
--
2.55.0.543.g5ebe2ebe4ea8
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: fix build against nettle >= 4
2026-08-13 7:40 [PATCH] crypto: fix build against nettle >= 4 marcandre.lureau
@ 2026-08-13 8:25 ` Philippe Mathieu-Daudé
2026-08-13 8:26 ` Philippe Mathieu-Daudé
2026-08-13 8:31 ` Daniel P. Berrangé
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-08-13 8:25 UTC (permalink / raw)
To: marcandre.lureau, qemu-devel; +Cc: berrange
On 13/8/26 09:40, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> 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 <marcandre.lureau@redhat.com>
> ---
> 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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: fix build against nettle >= 4
2026-08-13 7:40 [PATCH] crypto: fix build against nettle >= 4 marcandre.lureau
2026-08-13 8:25 ` Philippe Mathieu-Daudé
@ 2026-08-13 8:26 ` Philippe Mathieu-Daudé
2026-08-13 8:31 ` Daniel P. Berrangé
2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-08-13 8:26 UTC (permalink / raw)
To: marcandre.lureau, qemu-devel; +Cc: berrange
On 13/8/26 09:40, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> 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 <marcandre.lureau@redhat.com>
> ---
> crypto/hash-nettle.c | 6 ++++++
> 1 file changed, 6 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] crypto: fix build against nettle >= 4
2026-08-13 7:40 [PATCH] crypto: fix build against nettle >= 4 marcandre.lureau
2026-08-13 8:25 ` Philippe Mathieu-Daudé
2026-08-13 8:26 ` Philippe Mathieu-Daudé
@ 2026-08-13 8:31 ` Daniel P. Berrangé
2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2026-08-13 8:31 UTC (permalink / raw)
To: marcandre.lureau; +Cc: qemu-devel
On Thu, Aug 13, 2026 at 11:40:48AM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> 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.
They split the headers back in 2012 according to git, and our min
version is 3.7.3 which certainly has them, so drop the conditional.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4184
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> 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>
> --
> 2.55.0.543.g5ebe2ebe4ea8
>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-13 8:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 7:40 [PATCH] crypto: fix build against nettle >= 4 marcandre.lureau
2026-08-13 8:25 ` Philippe Mathieu-Daudé
2026-08-13 8:26 ` Philippe Mathieu-Daudé
2026-08-13 8:31 ` Daniel P. Berrangé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.