[packages/neatvnc] - patch for nettle 4.x compatibility

qboosh qboosh at pld-linux.org
Wed Jul 15 18:50:14 CEST 2026


commit 4c76301be1d80ad87b5f7f79d42854031c9d6b1d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Jul 15 18:50:00 2026 +0200

    - patch for nettle 4.x compatibility

 neatvnc-nettle4.patch | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++
 neatvnc.spec          |  2 ++
 2 files changed, 71 insertions(+)
---
diff --git a/neatvnc.spec b/neatvnc.spec
index ae10b38..f5374ff 100644
--- a/neatvnc.spec
+++ b/neatvnc.spec
@@ -12,6 +12,7 @@ Group:		Libraries
 #Source0Download: https://github.com/any1/neatvnc/releases
 Source0:	https://github.com/any1/neatvnc/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	81e6a811a77499439973cbafd11e0982
+Patch0:		%{name}-nettle4.patch
 URL:		https://github.com/any1/neatvnc
 BuildRequires:	Mesa-libgbm-devel
 BuildRequires:	aml-devel >= 1.0.0
@@ -86,6 +87,7 @@ Statyczna biblioteka neatvnc.
 
 %prep
 %setup -q
+%patch -P0 -p1
 
 %build
 %meson \
diff --git a/neatvnc-nettle4.patch b/neatvnc-nettle4.patch
new file mode 100644
index 0000000..7dd62f8
--- /dev/null
+++ b/neatvnc-nettle4.patch
@@ -0,0 +1,69 @@
+--- neatvnc-1.0.1/src/crypto/nettle/cipher.c.orig	2026-07-09 20:55:08.000000000 +0200
++++ neatvnc-1.0.1/src/crypto/nettle/cipher.c	2026-07-15 17:46:01.866331010 +0200
+@@ -22,6 +22,7 @@
+ #include <stdlib.h>
+ #include <nettle/aes.h>
+ #include <nettle/eax.h>
++#include <nettle/version.h>
+ 
+ struct crypto_aes_eax {
+ 	struct eax_aes128_ctx ctx;
+@@ -119,7 +120,11 @@ static bool crypto_cipher_aes_eax_encryp
+ 			(uint8_t*)dst->data + dst->len, src);
+ 	dst->len += src_len;
+ 
++#if NETTLE_VERSION_MAJOR >= 4
++	nettle_eax_aes128_digest(&self->enc_ctx.aes_eax.ctx, mac);
++#else
+ 	nettle_eax_aes128_digest(&self->enc_ctx.aes_eax.ctx, 16, mac);
++#endif
+ 
+ 	return true;
+ }
+@@ -131,7 +136,11 @@ static ssize_t crypto_cipher_aes_eax_dec
+ 	crypto_aes_eax_update_nonce(&self->dec_ctx.aes_eax);
+ 	nettle_eax_aes128_update(&self->dec_ctx.aes_eax.ctx, ad_len, ad);
+ 	nettle_eax_aes128_decrypt(&self->dec_ctx.aes_eax.ctx, len, dst, src);
++#if NETTLE_VERSION_MAJOR >= 4
++	nettle_eax_aes128_digest(&self->dec_ctx.aes_eax.ctx, mac);
++#else
+ 	nettle_eax_aes128_digest(&self->dec_ctx.aes_eax.ctx, 16, mac);
++#endif
+ 	return len;
+ }
+ 
+@@ -179,7 +188,11 @@ static bool crypto_cipher_aes256_eax_enc
+ 			(uint8_t*)dst->data + dst->len, src);
+ 	dst->len += src_len;
+ 
++#if NETTLE_VERSION_MAJOR >= 4
++	EAX_DIGEST(&self->enc_ctx.aes256_eax.ctx, aes256_encrypt, mac);
++#else
+ 	EAX_DIGEST(&self->enc_ctx.aes256_eax.ctx, aes256_encrypt, 16, mac);
++#endif
+ 
+ 	return true;
+ }
+@@ -191,7 +204,11 @@ static ssize_t crypto_cipher_aes256_eax_
+ 	crypto_aes256_eax_update_nonce(&self->dec_ctx.aes256_eax);
+ 	EAX_UPDATE(&self->dec_ctx.aes256_eax.ctx, aes256_encrypt, ad_len, ad);
+ 	EAX_DECRYPT(&self->dec_ctx.aes256_eax.ctx, aes256_encrypt, len, dst, src);
++#if NETTLE_VERSION_MAJOR >= 4
++	EAX_DIGEST(&self->dec_ctx.aes256_eax.ctx, aes256_encrypt, mac);
++#else
+ 	EAX_DIGEST(&self->dec_ctx.aes256_eax.ctx, aes256_encrypt, 16, mac);
++#endif
+ 	return len;
+ }
+ 
+--- neatvnc-1.0.1/src/crypto/nettle/hash.c.orig	2026-07-09 20:55:08.000000000 +0200
++++ neatvnc-1.0.1/src/crypto/nettle/hash.c	2026-07-15 17:48:05.688992338 +0200
+@@ -21,7 +21,7 @@
+ #include <stdlib.h>
+ #include <nettle/md5.h>
+ #include <nettle/sha1.h>
+-#include <nettle/sha.h>
++#include <nettle/sha2.h>
+ 
+ struct crypto_hash {
+ 	union {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/neatvnc.git/commitdiff/86a61b3120981d7d603618ad0071e1c1bbdd9654



More information about the pld-cvs-commit mailing list