Re: [PATCH] crypto: fix build against nettle >= 4

Philippe Mathieu-Daudé <[email protected]>
Newsgroups org.nongnu.qemu-devel
Message-ID <[email protected]>
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>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.