public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/neatvnc] f45: Fix build with nettle 4
@ 2026-09-17 12:31 Dominik 'Rathann' Mierzejewski
  0 siblings, 0 replies; only message in thread
From: Dominik 'Rathann' Mierzejewski @ 2026-09-17 12:31 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/neatvnc
            Branch : f45
            Commit : 5dd283bd02699a770cb8f76b47b57611f3112c27
            Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
            Date   : 2026-09-02T10:15:52+02:00
            Stats  : +270/-1 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/neatvnc/c/5dd283bd02699a770cb8f76b47b57611f3112c27?branch=f45

            Log:
            Fix build with nettle 4

Backport upstream commits:
5b190f0fd9e6b0bfd32752a9115242f87ec36c59
f97805deaaea489a1c8c851324163a92a3125195
8e0d226064d05d8b090747e5876c8e6880798fcb

---
diff --git a/0001-Use-nettle-hogweed-version-4.patch b/0001-Use-nettle-hogweed-version-4.patch
new file mode 100644
index 0000000..9730f5a
--- /dev/null
+++ b/0001-Use-nettle-hogweed-version-4.patch
@@ -0,0 +1,81 @@
+From 5b190f0fd9e6b0bfd32752a9115242f87ec36c59 Mon Sep 17 00:00:00 2001
+From: Andri Yngvason <andri@yngvason.is>
+Date: Sun, 17 May 2026 09:57:07 +0000
+Subject: [PATCH] Use nettle & hogweed version 4
+
+---
+ meson.build                | 6 ++++--
+ src/crypto/nettle/cipher.c | 8 ++++----
+ src/crypto/nettle/hash.c   | 2 +-
+ 3 files changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 71a9c25c..a2d2d5d9 100644
+--- a/meson.build
++++ b/meson.build
+@@ -61,8 +61,10 @@ libm = cc.find_library('m', required: false)
+ pixman = dependency('pixman-1')
+ libturbojpeg = dependency('libturbojpeg', required: get_option('jpeg'))
+ gnutls = dependency('gnutls', required: get_option('tls'))
+-nettle = dependency('nettle', required: get_option('nettle'))
+-hogweed = dependency('hogweed', required: get_option('nettle'))
++nettle = dependency('nettle', required: get_option('nettle'),
++                    version: ['>=4.0', '<5.0'])
++hogweed = dependency('hogweed', required: get_option('nettle'),
++                     version: ['>=4.0', '<5.0'])
+ gmp = dependency('gmp', required: get_option('nettle'))
+ zlib = dependency('zlib')
+ gbm = dependency('gbm', required: get_option('gbm'))
+diff --git a/src/crypto/nettle/cipher.c b/src/crypto/nettle/cipher.c
+index 0dd2262f..6eb8770f 100644
+--- a/src/crypto/nettle/cipher.c
++++ b/src/crypto/nettle/cipher.c
+@@ -119,7 +119,7 @@ static bool crypto_cipher_aes_eax_encrypt(struct crypto_cipher* self,
+ 			(uint8_t*)dst->data + dst->len, src);
+ 	dst->len += src_len;
+ 
+-	nettle_eax_aes128_digest(&self->enc_ctx.aes_eax.ctx, 16, mac);
++	nettle_eax_aes128_digest(&self->enc_ctx.aes_eax.ctx, mac);
+ 
+ 	return true;
+ }
+@@ -131,7 +131,7 @@ static ssize_t crypto_cipher_aes_eax_decrypt(struct crypto_cipher* self,
+ 	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);
+-	nettle_eax_aes128_digest(&self->dec_ctx.aes_eax.ctx, 16, mac);
++	nettle_eax_aes128_digest(&self->dec_ctx.aes_eax.ctx, mac);
+ 	return len;
+ }
+ 
+@@ -179,7 +179,7 @@ static bool crypto_cipher_aes256_eax_encrypt(struct crypto_cipher* self,
+ 			(uint8_t*)dst->data + dst->len, src);
+ 	dst->len += src_len;
+ 
+-	EAX_DIGEST(&self->enc_ctx.aes256_eax.ctx, aes256_encrypt, 16, mac);
++	EAX_DIGEST(&self->enc_ctx.aes256_eax.ctx, aes256_encrypt, mac);
+ 
+ 	return true;
+ }
+@@ -191,7 +191,7 @@ static ssize_t crypto_cipher_aes256_eax_decrypt(struct crypto_cipher* self,
+ 	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);
+-	EAX_DIGEST(&self->dec_ctx.aes256_eax.ctx, aes256_encrypt, 16, mac);
++	EAX_DIGEST(&self->dec_ctx.aes256_eax.ctx, aes256_encrypt, mac);
+ 	return len;
+ }
+ 
+diff --git a/src/crypto/nettle/hash.c b/src/crypto/nettle/hash.c
+index 71318f4a..9fbfe5f7 100644
+--- a/src/crypto/nettle/hash.c
++++ b/src/crypto/nettle/hash.c
+@@ -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 {

diff --git a/0002-crypto-Remove-hash-digest-size-argument.patch b/0002-crypto-Remove-hash-digest-size-argument.patch
new file mode 100644
index 0000000..9d39632
--- /dev/null
+++ b/0002-crypto-Remove-hash-digest-size-argument.patch
@@ -0,0 +1,157 @@
+From f97805deaaea489a1c8c851324163a92a3125195 Mon Sep 17 00:00:00 2001
+From: Andri Yngvason <andri@yngvason.is>
+Date: Tue, 19 May 2026 21:23:59 +0000
+Subject: [PATCH] crypto: Remove hash digest size argument
+
+This has been removed in nettle 4.
+---
+ include/crypto.h          |  7 +++----
+ src/auth/apple-dh.c       |  3 +--
+ src/auth/rsa-aes.c        | 16 ++++++++--------
+ src/crypto/nettle/hash.c  | 14 +++++++-------
+ src/stream/ws/handshake.c |  3 +--
+ 5 files changed, 20 insertions(+), 23 deletions(-)
+
+diff --git a/include/crypto.h b/include/crypto.h
+index 9a1aee41..1e5886f7 100644
+--- a/include/crypto.h
++++ b/include/crypto.h
+@@ -88,12 +88,11 @@ void crypto_hash_del(struct crypto_hash* self);
+ 
+ void crypto_hash_append(struct crypto_hash* self, const uint8_t* src,
+ 		size_t len);
+-void crypto_hash_digest(struct crypto_hash* self, uint8_t* dst,
+-		size_t len);
++void crypto_hash_digest(struct crypto_hash* self, uint8_t* dst);
+ 
+-void crypto_hash_one(uint8_t* dst, size_t dst_len, enum crypto_hash_type type,
++void crypto_hash_one(uint8_t* dst, enum crypto_hash_type type,
+ 		const uint8_t* src, size_t src_len);
+-void crypto_hash_many(uint8_t* dst, size_t dst_len, enum crypto_hash_type type,
++void crypto_hash_many(uint8_t* dst, enum crypto_hash_type type,
+ 		const struct crypto_data_entry *src);
+ 
+ // RSA
+diff --git a/src/auth/apple-dh.c b/src/auth/apple-dh.c
+index 43833970..23856186 100644
+--- a/src/auth/apple-dh.c
++++ b/src/auth/apple-dh.c
+@@ -78,8 +78,7 @@ int apple_dh_handle_response(struct nvnc_client* client)
+ 	crypto_key_del(shared_secret);
+ 
+ 	uint8_t hash[16] = {};
+-	crypto_hash_one(hash, sizeof(hash), CRYPTO_HASH_MD5, shared_buf,
+-			sizeof(shared_buf));
++	crypto_hash_one(hash, CRYPTO_HASH_MD5, shared_buf, sizeof(shared_buf));
+ 
+ 	struct crypto_cipher* cipher;
+ 	cipher = crypto_cipher_new(NULL, hash, CRYPTO_CIPHER_AES128_ECB);
+diff --git a/src/auth/rsa-aes.c b/src/auth/rsa-aes.c
+index dea2e7c8..d2f217d4 100644
+--- a/src/auth/rsa-aes.c
++++ b/src/auth/rsa-aes.c
+@@ -154,8 +154,8 @@ static int on_rsa_aes_challenge(struct nvnc_client* client)
+ 
+ 	// ClientSessionKey = the first 16 bytes of SHA1(ServerRandom || ClientRandom)
+ 	uint8_t client_session_key[32];
+-	crypto_hash_many(client_session_key, client_rsa_aes_hash_len(client),
+-			client->rsa.hash_type, (const struct crypto_data_entry[]) {
++	crypto_hash_many(client_session_key, client->rsa.hash_type,
++			(const struct crypto_data_entry[]) {
+ 		{ client->rsa.challenge, client->rsa.challenge_len },
+ 		{ client_random, client->rsa.challenge_len },
+ 		{}
+@@ -163,8 +163,8 @@ static int on_rsa_aes_challenge(struct nvnc_client* client)
+ 
+ 	// ServerSessionKey = the first 16 bytes of SHA1(ClientRandom || ServerRandom)
+ 	uint8_t server_session_key[32];
+-	crypto_hash_many(server_session_key, client_rsa_aes_hash_len(client),
+-			client->rsa.hash_type, (const struct crypto_data_entry[]) {
++	crypto_hash_many(server_session_key, client->rsa.hash_type,
++			(const struct crypto_data_entry[]) {
+ 		{ client_random, client->rsa.challenge_len },
+ 		{ client->rsa.challenge, client->rsa.challenge_len },
+ 		{}
+@@ -195,8 +195,8 @@ static int on_rsa_aes_challenge(struct nvnc_client* client)
+ 	uint32_t client_key_len_be = htonl(client_key_len * 8);
+ 
+ 	uint8_t server_hash[32] = {};
+-	crypto_hash_many(server_hash, client_rsa_aes_hash_len(client),
+-			client->rsa.hash_type, (const struct crypto_data_entry[]) {
++	crypto_hash_many(server_hash, client->rsa.hash_type,
++			(const struct crypto_data_entry[]) {
+ 		{ (uint8_t*)&server_key_len_be, 4 },
+ 		{ server_modulus, server_key_len },
+ 		{ server_exponent, server_key_len },
+@@ -249,8 +249,8 @@ static int on_rsa_aes_client_hash(struct nvnc_client* client)
+ 	uint32_t client_key_len_be = htonl(client_key_len * 8);
+ 
+ 	uint8_t client_hash[32] = {};
+-	crypto_hash_many(client_hash, client_rsa_aes_hash_len(client),
+-			client->rsa.hash_type, (const struct crypto_data_entry[]) {
++	crypto_hash_many(client_hash, client->rsa.hash_type,
++			(const struct crypto_data_entry[]) {
+ 		{ (uint8_t*)&client_key_len_be, 4 },
+ 		{ client_modulus, client_key_len },
+ 		{ client_exponent, client_key_len },
+diff --git a/src/crypto/nettle/hash.c b/src/crypto/nettle/hash.c
+index 9fbfe5f7..83295330 100644
+--- a/src/crypto/nettle/hash.c
++++ b/src/crypto/nettle/hash.c
+@@ -31,7 +31,7 @@ struct crypto_hash {
+ 	} ctx;
+ 
+ 	void (*update)(void* ctx, size_t len, const uint8_t* src);
+-	void (*digest)(void* ctx, size_t len, uint8_t* dst);
++	void (*digest)(void* ctx, uint8_t* dst);
+ };
+ 
+ struct crypto_hash* crypto_hash_new(enum crypto_hash_type type)
+@@ -75,27 +75,27 @@ void crypto_hash_append(struct crypto_hash* self, const uint8_t* src,
+ 	self->update(&self->ctx, len, src);
+ }
+ 
+-void crypto_hash_digest(struct crypto_hash* self, uint8_t* dst, size_t len)
++void crypto_hash_digest(struct crypto_hash* self, uint8_t* dst)
+ {
+-	self->digest(&self->ctx, len, dst);
++	self->digest(&self->ctx, dst);
+ }
+ 
+-void crypto_hash_one(uint8_t* dst, size_t dst_len, enum crypto_hash_type type,
++void crypto_hash_one(uint8_t* dst, enum crypto_hash_type type,
+ 		const uint8_t* src, size_t src_len)
+ {
+ 	struct crypto_hash *hash = crypto_hash_new(type);
+ 	crypto_hash_append(hash, src, src_len);
+-	crypto_hash_digest(hash, dst, dst_len);
++	crypto_hash_digest(hash, dst);
+ 	crypto_hash_del(hash);
+ }
+ 
+-void crypto_hash_many(uint8_t* dst, size_t dst_len, enum crypto_hash_type type,
++void crypto_hash_many(uint8_t* dst, enum crypto_hash_type type,
+ 		const struct crypto_data_entry *src)
+ {
+ 	struct crypto_hash *hash = crypto_hash_new(type);
+ 	for (int i = 0; src[i].data && src[i].len; ++i)
+ 		crypto_hash_append(hash, src[i].data, src[i].len);
+-	crypto_hash_digest(hash, dst, dst_len);
++	crypto_hash_digest(hash, dst);
+ 	crypto_hash_del(hash);
+ }
+ 
+diff --git a/src/stream/ws/handshake.c b/src/stream/ws/handshake.c
+index 80881189..aa0db3f9 100644
+--- a/src/stream/ws/handshake.c
++++ b/src/stream/ws/handshake.c
+@@ -79,8 +79,7 @@ ssize_t ws_handshake(char* output, size_t output_maxlen, const char* input)
+ 		goto failure;
+ 
+ 	uint8_t hash[20];
+-	crypto_hash_many(hash, sizeof(hash), CRYPTO_HASH_SHA1,
+-			(struct crypto_data_entry[]){
++	crypto_hash_many(hash, sizeof(hash), (struct crypto_data_entry[]){
+ 		{ (uint8_t*)challenge, strlen(challenge) },
+ 		{ (uint8_t*)magic_uuid, strlen(magic_uuid) },
+ 		{}

diff --git a/0003-stream-ws-handshake-Fix-crypto_hash_many-argument-mi.patch b/0003-stream-ws-handshake-Fix-crypto_hash_many-argument-mi.patch
new file mode 100644
index 0000000..dbd9903
--- /dev/null
+++ b/0003-stream-ws-handshake-Fix-crypto_hash_many-argument-mi.patch
@@ -0,0 +1,23 @@
+From 8e0d226064d05d8b090747e5876c8e6880798fcb Mon Sep 17 00:00:00 2001
+From: Andri Yngvason <andri@yngvason.is>
+Date: Thu, 30 Jul 2026 10:35:25 +0000
+Subject: [PATCH] stream: ws: handshake: Fix crypto_hash_many argument mixup
+
+This fixes mistake in f97805deaaea489a1c8c851324163a92a3125195.
+---
+ src/stream/ws/handshake.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/stream/ws/handshake.c b/src/stream/ws/handshake.c
+index aa0db3f9..9cb6f1c5 100644
+--- a/src/stream/ws/handshake.c
++++ b/src/stream/ws/handshake.c
+@@ -79,7 +79,7 @@ ssize_t ws_handshake(char* output, size_t output_maxlen, const char* input)
+ 		goto failure;
+ 
+ 	uint8_t hash[20];
+-	crypto_hash_many(hash, sizeof(hash), (struct crypto_data_entry[]){
++	crypto_hash_many(hash, CRYPTO_HASH_SHA1, (struct crypto_data_entry[]){
+ 		{ (uint8_t*)challenge, strlen(challenge) },
+ 		{ (uint8_t*)magic_uuid, strlen(magic_uuid) },
+ 		{}

diff --git a/neatvnc.spec b/neatvnc.spec
index e903dda..c4dd5ce 100644
--- a/neatvnc.spec
+++ b/neatvnc.spec
@@ -2,7 +2,7 @@
 
 Name:     neatvnc
 Version:  0.9.0
-Release:  7%{?dist}
+Release:  8%{?dist}
 Summary:  Liberally licensed VNC server library
 # main source is ISC
 # include/sys/queue.h is BSD
@@ -15,6 +15,11 @@ Source:   %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
 # From: https://github.com/any1/neatvnc/commit/e0e0ce5c579cafc763992f1c1bb964eb95999fb7
 Patch:    0001-server-Use-correct-type-for-length-in-compress.patch
 
+# Backport to fix build with nettle 4
+Patch:    https://github.com/any1/neatvnc/commit/5b190f0fd9e6b0bfd32752a9115242f87ec36c59.patch#/0001-Use-nettle-hogweed-version-4.patch
+Patch:    https://github.com/any1/neatvnc/commit/f97805deaaea489a1c8c851324163a92a3125195.patch#/0002-crypto-Remove-hash-digest-size-argument.patch
+Patch:    https://github.com/any1/neatvnc/commit/8e0d226064d05d8b090747e5876c8e6880798fcb.patch#/0003-stream-ws-handshake-Fix-crypto_hash_many-argument-mi.patch
+
 BuildRequires: gcc
 BuildRequires: git-core
 BuildRequires: meson
@@ -64,6 +69,9 @@ This package contains header files for %{name}.
 %{_libdir}/pkgconfig/%{name}.pc
 
 %changelog
+* Wed Aug 19 2026 Dominik Mierzejewski <dominik@greysector.net> - 0.9.0-8
+- Fix build with nettle 4
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-17 12:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 12:31 [rpms/neatvnc] f45: Fix build with nettle 4 Dominik 'Rathann' Mierzejewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox