Thread View: linux.debian.bugs.dist
1 messages
1 total messages
Started by Andreas Metzler
Sun, 22 Nov 2026 13:10
Bug#1154823: trixie-pu: package gnutls28/3.8.9-3+deb13u5
Author: Andreas Metzler
Date: Sun, 22 Nov 2026 13:10
Date: Sun, 22 Nov 2026 13:10
752 lines
28698 bytes
28698 bytes
--VduLCJ3hQN+EpH9H
Content-Type: multipart/mixed; boundary="9XrlL696LcAByNwT"
Content-Disposition: inline
--9XrlL696LcAByNwT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: gnutls28@packages.debian.org
Control: affects -1 + src:gnutls28
User: release.debian.org@packages.debian.org
Usertags: pu
Hello,
I would like to fix minor security issues and two regressions:
* Fix TLS 1.3 handshake.
Backport this fix released in gnutls-3.8.13 to fix a regression with T=
LS
1.3 handshake after this commit in openjdk (both Debian 12 and 13
openjdk packages are affected):
https://bugs.openjdk.org/browse/JDK-8349583
Closes: 1142662
* Cherry-pick fixes from 3.8.14 release.
libgnutls: Fix crash on certificate list memory allocation failure
On allocation failure, the certificate list pointer and count could
get out of sync, causing a NULL deref or double-free during session
cleanup.
Both fields are now zeroized before the allocation.
Reported by Joshua Rogers of AISLE Research Team.
[GNUTLS-SA-2026-11-18-1, severity: low] [CVE-2026-127039]
libgnutls: Fix crash in RSA-PSK username copy memory allocation failur=
e A
missing return on a failed username copy could crash the handshake when
memory allocation fails.
The error is now propagated, aborting the handshake.
Reported by Joshua Rogers of AISLE Research Team.
[GNUTLS-SA-2026-11-18-2, severity: low] [CVE-2026-127040]
These two non-DSA issues are tracked in #1154435
* Cherry-pick patches from 3.8.11 to fix plc11 module init.
Fixes regression from the patchset for the CVE-2025-9820 fix.
Closes: #1154411
[ Checklist ]
[x] *all* changes are documented in the d/changelog
[x] I reviewed all changes and I approve them
[ x attach debdiff against the package in (old)stable
[x] the issue is verified as fixed in unstable
cu Andreas
--=20
"You people are noisy," Nia said.
I made the gesture of agreement.
--9XrlL696LcAByNwT
Content-Type: text/x-diff; charset=iso-8859-1
Content-Disposition: attachment; filename=u5.debd.diff
Content-Transfer-Encoding: quoted-printable
diff -Nru gnutls28-3.8.9/debian/changelog gnutls28-3.8.9/debian/changelog
--- gnutls28-3.8.9/debian/changelog 2026-05-10 13:15:39.000000000 +0200
+++ gnutls28-3.8.9/debian/changelog 2026-11-21 16:41:55.000000000 +0100
@@ -1,3 +1,34 @@
+gnutls28 (3.8.9-3+deb13u5) trixie; urgency=3Dmedium
+
+ [ Romain Tarti=E8re ]
+ * Fix TLS 1.3 handshake.
+ Backport this fix released in gnutls-3.8.13 to fix a regression with T=
LS
+ 1.3 handshake after this commit in openjdk (both Debian 12 and 13
+ openjdk packages are affected):
+ https://bugs.openjdk.org/browse/JDK-8349583
+ Closes: 1142662
+
+ [ Andreas Metzler ]
+ * Cherry-pick fixes from 3.8.14 release.
+ libgnutls: Fix crash on certificate list memory allocation failure
+ On allocation failure, the certificate list pointer and count could
+ get out of sync, causing a NULL deref or double-free during session
+ cleanup.
+ Both fields are now zeroized before the allocation.
+ Reported by Joshua Rogers of AISLE Research Team.
+ [GNUTLS-SA-2026-11-18-1, severity: low] [CVE-2026-127039]
+ libgnutls: Fix crash in RSA-PSK username copy memory allocation failur=
e A
+ missing return on a failed username copy could crash the handshake when
+ memory allocation fails.
+ The error is now propagated, aborting the handshake.
+ Reported by Joshua Rogers of AISLE Research Team.
+ [GNUTLS-SA-2026-11-18-2, severity: low] [CVE-2026-127040] Closes: #115=
4435
+ * Cherry-pick patches from 3.8.11 to fix pkcs11 module init.
+ Fixes regression from the patchset for the CVE-2025-9820 fix.
+ Closes: #1154411
+
+ -- Andreas Metzler <ametzler@debian.org> Sat, 21 Nov 2026 16:41:55 +0100
+
gnutls28 (3.8.9-3+deb13u4) trixie-security; urgency=3Dhigh
=20
* Add 3.8.13 patchset from CentOS 10 security release.
diff -Nru gnutls28-3.8.9/debian/patches/54_fix-tls-1.3-handshake.patch gnut=
ls28-3.8.9/debian/patches/54_fix-tls-1.3-handshake.patch
--- gnutls28-3.8.9/debian/patches/54_fix-tls-1.3-handshake.patch 1970-01-01=
01:00:00.000000000 +0100
+++ gnutls28-3.8.9/debian/patches/54_fix-tls-1.3-handshake.patch 2026-11-21=
13:18:24.000000000 +0100
@@ -0,0 +1,58 @@
+From 57830464c548cd2346eca624961257b99c0e8dfc Mon Sep 17 00:00:00 2001
+From: =3D?UTF-8?q?Romain=3D20Tarti=3DC3=3DA8re?=3D <romain@blogreen.org>
+Date: Thu, 16 Apr 2026 14:08:31 -1000
+Subject: [PATCH] Fix TLS 1.3 handshake
+MIME-Version: 1.0
+Content-Type: text/plain; charset=3DUTF-8
+Content-Transfer-Encoding: 8bit
+
+Add the signature_algorithms_cert to the list of allowed algorithms if
+present, and fallback to the signature_algorithms otherwise.
+
+This better fit [RFC8446 section 4.2.3][1]:
+
+> If no "signature_algorithms_cert" extension is present, then the
+> "signature_algorithms" extension also applies to signatures appearing
+> in certificates.
+
+This fix TLS 1.3 handshake with Java after [JDK-8349583][2].
+
+[1]: https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.3
+[2]: https://bugs.openjdk.org/browse/JDK-8349583
+
+Signed-off-by: Romain Tarti=E8re <romain@blogreen.org>
+---
+ lib/tls13/certificate_request.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/lib/tls13/certificate_request.c b/lib/tls13/certificate_reque=
st.c
+index 8a8a1499af..3c298cca72 100644
+--- a/lib/tls13/certificate_request.c
++++ b/lib/tls13/certificate_request.c
+@@ -108,15 +108,21 @@ static int parse_cert_extension(void *_ctx, unsigned=
tls_id,
+ if (se =3D=3D NULL)
+ continue;
+=20
++ gnutls_pk_algorithm_t algo;
++ if (se->cert_pk !=3D GNUTLS_PK_UNKNOWN)
++ algo =3D se->cert_pk;
++ else
++ algo =3D se->pk;
++
+ if (ctx->pk_algos_length >=3D
+ sizeof(ctx->pk_algos) / sizeof(ctx->pk_algos[0]))
+ break;
+=20
+- if (is_algo_in_list(se->pk, ctx->pk_algos,
++ if (is_algo_in_list(algo, ctx->pk_algos,
+ ctx->pk_algos_length))
+ continue;
+=20
+- ctx->pk_algos[ctx->pk_algos_length++] =3D se->pk;
++ ctx->pk_algos[ctx->pk_algos_length++] =3D algo;
+ }
+ #ifdef ENABLE_OCSP
+ } else if (tls_id =3D=3D ext_mod_status_request.tls_id) {
+--=20
+GitLab
+
diff -Nru gnutls28-3.8.9/debian/patches/55_01_0001-_gnutls_pcert_to_auth_in=
fo-always-zeroize-cert-list-.patch gnutls28-3.8.9/debian/patches/55_01_0001=
-_gnutls_pcert_to_auth_info-always-zeroize-cert-list-.patch
--- gnutls28-3.8.9/debian/patches/55_01_0001-_gnutls_pcert_to_auth_info-alw=
ays-zeroize-cert-list-.patch 1970-01-01 01:00:00.000000000 +0100
+++ gnutls28-3.8.9/debian/patches/55_01_0001-_gnutls_pcert_to_auth_info-alw=
ays-zeroize-cert-list-.patch 2026-11-21 13:31:46.000000000 +0100
@@ -0,0 +1,64 @@
+From 0cf60141ca2c1289e96847261ff355010cb6f3a8 Mon Sep 17 00:00:00 2001
+From: Zoltan Fridrich <zfridric@redhat.com>
+Date: Mon, 4 May 2026 11:33:15 +0200
+Subject: [PATCH 1/2] _gnutls_pcert_to_auth_info: always zeroize cert list
+ after cleaning it up
+
+Fixes: #1863
+Fixes: CVE-2026-127039
+Fixes: GNUTLS-SA-2026-11-18-1
+Severity: Low
+Introduced-in: bb3bc56370e3b291219695bec5d4e1cbfc3241be 2.5.9
+Reported-by: Joshua Rogers of AISLE Research Team <joshua@joshua.hu>
+Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
+---
+ lib/auth/cert.c | 21 ++++++++-------------
+ 1 file changed, 8 insertions(+), 13 deletions(-)
+
+diff --git a/lib/auth/cert.c b/lib/auth/cert.c
+index 71f87c237b..fbdc84036d 100644
+--- a/lib/auth/cert.c
++++ b/lib/auth/cert.c
+@@ -84,31 +84,26 @@ enum CertificateSigTypeFlags {
+ int _gnutls_pcert_to_auth_info(cert_auth_info_t info, gnutls_pcert_st *ce=
rts,
+ size_t ncerts)
+ {
+- size_t i, j;
+-
+ if (info->raw_certificate_list !=3D NULL) {
+- for (j =3D 0; j < info->ncerts; j++)
+- _gnutls_free_datum(&info->raw_certificate_list[j]);
++ for (size_t i =3D 0; i < info->ncerts; i++)
++ _gnutls_free_datum(&info->raw_certificate_list[i]);
+ gnutls_free(info->raw_certificate_list);
+ }
++ info->raw_certificate_list =3D NULL;
++ info->ncerts =3D 0;
+=20
+- if (ncerts =3D=3D 0) {
+- info->raw_certificate_list =3D NULL;
+- info->ncerts =3D 0;
++ if (ncerts =3D=3D 0)
+ return 0;
+- }
+=20
+ info->raw_certificate_list =3D
+ gnutls_calloc(ncerts, sizeof(gnutls_datum_t));
+- if (info->raw_certificate_list =3D=3D NULL) {
+- gnutls_assert();
+- return GNUTLS_E_MEMORY_ERROR;
+- }
++ if (info->raw_certificate_list =3D=3D NULL)
++ return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
+=20
+ info->cert_type =3D certs[0].type;
+ info->ncerts =3D ncerts;
+=20
+- for (i =3D 0; i < ncerts; i++) {
++ for (size_t i =3D 0; i < ncerts; i++) {
+ info->raw_certificate_list[i].data =3D certs[i].cert.data;
+ info->raw_certificate_list[i].size =3D certs[i].cert.size;
+ certs[i].cert.data =3D NULL;
+--=20
+2.53.0
+
diff -Nru gnutls28-3.8.9/debian/patches/55_01_0002-NEWS-add-an-entry-for-CV=
E-2026-127039.patch gnutls28-3.8.9/debian/patches/55_01_0002-NEWS-add-an-en=
try-for-CVE-2026-127039.patch
--- gnutls28-3.8.9/debian/patches/55_01_0002-NEWS-add-an-entry-for-CVE-2026=
-127039.patch 1970-01-01 01:00:00.000000000 +0100
+++ gnutls28-3.8.9/debian/patches/55_01_0002-NEWS-add-an-entry-for-CVE-2026=
-127039.patch 2026-11-21 13:42:17.000000000 +0100
@@ -0,0 +1,33 @@
+From 847261c734b3c6e9d7505d24ecce6b2ee0f64d5e Mon Sep 17 00:00:00 2001
+From: Alexander Sosedkin <asosedkin@redhat.com>
+Date: Tue, 14 Jul 2026 19:08:39 +0200
+Subject: [PATCH 2/2] NEWS: add an entry for CVE-2026-127039
+
+Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
+---
+ NEWS | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/NEWS
++++ b/NEWS
+@@ -3,10 +3,20 @@ Bug numbers referenced in this log corre
+ available at https://gitlab.com/gnutls/gnutls/issues
+ Copyright (C) 2000-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2019 Nikos Mavrogiannopoulos
+ See the end for copying conditions.
+=20
++
++
++** libgnutls: Fix crash on certificate list memory allocation failure
++ On allocation failure, the certificate list pointer and count could
++ get out of sync, causing a NULL deref or double-free during session cl=
eanup.
++ Both fields are now zeroized before the allocation.
++ Reported by Joshua Rogers of AISLE Research Team.
++ [GNUTLS-SA-2026-11-18-1, severity: low] [CVE-2026-127039]
++
++
+ * Version 3.8.11
+=20
+ ** libgnutls: Fix stack overwrite in gnutls_pkcs11_token_init
+ Reported by Luigino Camastra from Aisle Research. [GNUTLS-SA-2025-11-1=
8,
+ CVSS: low] [CVE-2025-9820]
diff -Nru gnutls28-3.8.9/debian/patches/55_02_0001-rsa_psk.c-add-missing-re=
turn.patch gnutls28-3.8.9/debian/patches/55_02_0001-rsa_psk.c-add-missing-r=
eturn.patch
--- gnutls28-3.8.9/debian/patches/55_02_0001-rsa_psk.c-add-missing-return.p=
atch 1970-01-01 01:00:00.000000000 +0100
+++ gnutls28-3.8.9/debian/patches/55_02_0001-rsa_psk.c-add-missing-return.p=
atch 2026-11-21 13:31:46.000000000 +0100
@@ -0,0 +1,32 @@
+From 8767518753a633e5ef59f112310db8dc9ff6771a Mon Sep 17 00:00:00 2001
+From: Zoltan Fridrich <zfridric@redhat.com>
+Date: Tue, 5 May 2026 14:51:00 +0200
+Subject: [PATCH 1/2] rsa_psk.c: add missing return
+
+Fixes: #1868
+Fixes: CVE-2026-127040
+Fixes: GNUTLS-SA-2026-11-18-2
+Severity: Low
+Introduced-in: f032324af70b8420f7b550f3277efd4a9cd2b2dd 3.7.7
+Reported-by: Joshua Rogers of AISLE Research Team <joshua@joshua.hu>
+Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
+---
+ lib/auth/rsa_psk.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/auth/rsa_psk.c b/lib/auth/rsa_psk.c
+index bf88cad0b6..240558f554 100644
+--- a/lib/auth/rsa_psk.c
++++ b/lib/auth/rsa_psk.c
+@@ -297,7 +297,7 @@ static int _gnutls_proc_rsa_psk_client_kx(gnutls_sessi=
on_t session,
+=20
+ ret =3D _gnutls_copy_psk_username(info, username);
+ if (ret < 0)
+- gnutls_assert_val(ret);
++ return gnutls_assert_val(ret);
+=20
+ /* Adjust data so it points to EncryptedPreMasterSecret */
+ data +=3D username.size + 2;
+--=20
+2.53.0
+
diff -Nru gnutls28-3.8.9/debian/patches/55_02_0002-NEWS-add-an-entry-for-CV=
E-2026-127040.patch gnutls28-3.8.9/debian/patches/55_02_0002-NEWS-add-an-en=
try-for-CVE-2026-127040.patch
--- gnutls28-3.8.9/debian/patches/55_02_0002-NEWS-add-an-entry-for-CVE-2026=
-127040.patch 1970-01-01 01:00:00.000000000 +0100
+++ gnutls28-3.8.9/debian/patches/55_02_0002-NEWS-add-an-entry-for-CVE-2026=
-127040.patch 2026-11-21 13:42:18.000000000 +0100
@@ -0,0 +1,30 @@
+From 62f3cc5409195aa175dd9e6f5d1bd6291dac844c Mon Sep 17 00:00:00 2001
+From: Alexander Sosedkin <monk@unboiled.info>
+Date: Thu, 5 Nov 2026 19:20:17 +0100
+Subject: [PATCH 2/2] NEWS: add an entry for CVE-2026-127040
+
+Signed-off-by: Alexander Sosedkin <monk@unboiled.info>
+---
+ NEWS | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/NEWS
++++ b/NEWS
+@@ -12,10 +12,17 @@ See the end for copying conditions.
+ get out of sync, causing a NULL deref or double-free during session cl=
eanup.
+ Both fields are now zeroized before the allocation.
+ Reported by Joshua Rogers of AISLE Research Team.
+ [GNUTLS-SA-2026-11-18-1, severity: low] [CVE-2026-127039]
+=20
++** libgnutls: Fix crash in RSA-PSK username copy memory allocation failure
++ A missing return on a failed username copy could crash the handshake
++ when memory allocation fails.
++ The error is now propagated, aborting the handshake.
++ Reported by Joshua Rogers of AISLE Research Team.
++ [GNUTLS-SA-2026-11-18-2, severity: low] [CVE-2026-127040]
++
+=20
+ * Version 3.8.11
+=20
+ ** libgnutls: Fix stack overwrite in gnutls_pkcs11_token_init
+ Reported by Luigino Camastra from Aisle Research. [GNUTLS-SA-2025-11-1=
8,
diff -Nru gnutls28-3.8.9/debian/patches/56-01-pkcs11-properly-fall-back-to-=
thread-unsafe-module-in.patch gnutls28-3.8.9/debian/patches/56-01-pkcs11-pr=
operly-fall-back-to-thread-unsafe-module-in.patch
--- gnutls28-3.8.9/debian/patches/56-01-pkcs11-properly-fall-back-to-thread=
-unsafe-module-in.patch 1970-01-01 01:00:00.000000000 +0100
+++ gnutls28-3.8.9/debian/patches/56-01-pkcs11-properly-fall-back-to-thread=
-unsafe-module-in.patch 2026-11-21 16:41:55.000000000 +0100
@@ -0,0 +1,119 @@
+From f6680ada01ac8757f372cd7b97fd80e33c79c927 Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno@gnu.org>
+Date: Mon, 22 Dec 2025 15:29:06 +0900
+Subject: [PATCH 1/2] pkcs11: properly fall back to thread-unsafe module in=
it
+
+The PKCS#11 module initialization logic introduced in
+aa5f15a872e62e54abe58624ee393e68d1faf689 first attempts to initialize
+the module with CKR_NEED_TO_CREATE_THREADS|CKF_OS_LOCKING_OK, which
+may return either CKR_CANT_LOCK or CKR_NEED_TO_CREATE_THREADS, where
+the latter was previously treated as a hard error. This fixes it and
+also makes the second attempt to not supply any flags.
+
+Signed-off-by: Daiki Ueno <ueno@gnu.org>
+---
+ .gitignore | 1 +
+ lib/pkcs11.c | 21 ++++++++++++---------
+ tests/pkcs11/pkcs11-mock4.c | 10 ++++++----
+ 3 files changed, 19 insertions(+), 13 deletions(-)
+
+diff --git a/lib/pkcs11.c b/lib/pkcs11.c
+index 021974f5fa..668d91bb13 100644
+--- a/lib/pkcs11.c
++++ b/lib/pkcs11.c
+@@ -251,18 +251,14 @@ static const struct ck_c_initialize_args default_ini=
t_args =3D {
+ NULL,
+ NULL,
+ NULL,
+ CKF_LIBRARY_CANT_CREATE_OS_THREADS | CKF_OS_LOCKING_OK,
+ NULL,
+ };
+=20
+-static const struct ck_c_initialize_args no_thread_init_args =3D {
+- NULL, NULL, NULL, NULL, CKF_LIBRARY_CANT_CREATE_OS_THREADS, NULL,
+-};
+-
+ static void pkcs11_provider_deinit(struct gnutls_pkcs11_provider_st *prov=
ider)
+ {
+ p11_kit_module_finalize(provider->module);
+ p11_kit_module_release(provider->module);
+ gnutls_free(provider->init_args.reserved);
+ }
+=20
+@@ -280,23 +276,30 @@ static int pkcs11_provider_init(struct gnutls_pkcs11=
_provider_st *provider,
+=20
+ _gnutls_debug_log("p11: Initializing module: %s\n", name);
+=20
+ if (params && (p =3D strstr(params, "p11-kit:")) !=3D 0) {
+ reserved =3D (char *)(p + sizeof("p11-kit:") - 1);
+ }
+=20
+- /* First try with CKF_OS_LOCKING_OK, then fall back without it */
++ /* First try with CKF_LIBRARY_CANT_CREATE_OS_THREADS |
++ * CKF_OS_LOCKING_OK, then fall back without it */
+ args =3D default_init_args;
+ args.reserved =3D (void *)reserved;
+ rv =3D module->C_Initialize(&args);
+=20
+- if (rv =3D=3D CKR_CANT_LOCK) {
+- args =3D no_thread_init_args;
+- args.reserved =3D (void *)reserved;
+- rv =3D module->C_Initialize(&args);
++ if (rv =3D=3D CKR_NEED_TO_CREATE_THREADS || rv =3D=3D CKR_CANT_LOCK) {
++ struct ck_c_initialize_args *pargs;
++ if (reserved) {
++ memset(&args, 0, sizeof(args));
++ args.reserved =3D (void *)reserved;
++ pargs =3D &args;
++ } else {
++ pargs =3D NULL;
++ }
++ rv =3D module->C_Initialize(pargs);
+ }
+=20
+ if (rv !=3D CKR_OK) {
+ int ret;
+=20
+ gnutls_assert();
+ free(name);
+diff --git a/tests/pkcs11/pkcs11-mock4.c b/tests/pkcs11/pkcs11-mock4.c
+index ffa684b52f..3fd24eae29 100644
+--- a/tests/pkcs11/pkcs11-mock4.c
++++ b/tests/pkcs11/pkcs11-mock4.c
+@@ -50,27 +50,29 @@ static CK_FUNCTION_LIST override_funcs;
+ #define _CONSTRUCTOR
+ #define _DESTRUCTOR
+ #else
+ #define _CONSTRUCTOR __attribute__((constructor))
+ #define _DESTRUCTOR __attribute__((destructor))
+ #endif
+=20
++#define LOCK_FLAGS (CKF_LIBRARY_CANT_CREATE_OS_THREADS | CKF_OS_LOCKING_O=
K)
++
+ static CK_RV override_C_Initialize(void *args)
+ {
+ CK_C_INITIALIZE_ARGS *init_args =3D args;
+ static bool first =3D true;
+=20
+- assert(init_args);
+-
+ if (first) {
+- assert(init_args->flags & CKF_OS_LOCKING_OK);
++ assert(init_args &&
++ (init_args->flags & LOCK_FLAGS) =3D=3D LOCK_FLAGS);
+ first =3D false;
+ return CKR_CANT_LOCK;
+ } else {
+- assert(!(init_args->flags & CKF_OS_LOCKING_OK));
++ assert(!init_args ||
++ (init_args->flags & LOCK_FLAGS) !=3D LOCK_FLAGS);
+ }
+=20
+ return base_C_Initialize(args);
+ }
+=20
+ CK_RV C_GetFunctionList(CK_FUNCTION_LIST **function_list)
+ {
+--=20
+2.53.0
+
diff -Nru gnutls28-3.8.9/debian/patches/56-02-pkcs11-fix-module-name-resolu=
tion-for-unconfigured-m.patch gnutls28-3.8.9/debian/patches/56-02-pkcs11-fi=
x-module-name-resolution-for-unconfigured-m.patch
--- gnutls28-3.8.9/debian/patches/56-02-pkcs11-fix-module-name-resolution-f=
or-unconfigured-m.patch 1970-01-01 01:00:00.000000000 +0100
+++ gnutls28-3.8.9/debian/patches/56-02-pkcs11-fix-module-name-resolution-f=
or-unconfigured-m.patch 2026-11-21 16:41:55.000000000 +0100
@@ -0,0 +1,193 @@
+From 9a9913fde956a600e057786558a335dff7849531 Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno@gnu.org>
+Date: Mon, 22 Dec 2025 18:20:25 +0900
+Subject: [PATCH 2/2] pkcs11: fix module name resolution for unconfigured
+ modules
+
+When a PKCS#11 module is not configured, p11_kit_module_get_name()
+returns NULL. In that case, use the filename instead.
+
+Signed-off-by: Daiki Ueno <ueno@gnu.org>
+---
+ lib/pkcs11.c | 35 +++++++++++++++--------------------
+ 1 file changed, 15 insertions(+), 20 deletions(-)
+
+diff --git a/lib/pkcs11.c b/lib/pkcs11.c
+index 668d91bb13..9f3bb551c4 100644
+--- a/lib/pkcs11.c
++++ b/lib/pkcs11.c
+@@ -58,14 +58,15 @@
+ #define CKA_NSS_EMAIL_DISTRUST_AFTER 0xce534374UL
+ #endif
+=20
+ GNUTLS_STATIC_MUTEX(pkcs11_mutex);
+=20
+ struct gnutls_pkcs11_provider_st {
+ struct ck_function_list *module;
++ char *module_name;
+ unsigned active;
+ unsigned trusted; /* in the sense of p11-kit trusted:
+ * it can be used for verification */
+ struct ck_info info;
+ struct ck_c_initialize_args init_args;
+ };
+=20
+@@ -256,29 +257,27 @@ static const struct ck_c_initialize_args default_ini=
t_args =3D {
+ };
+=20
+ static void pkcs11_provider_deinit(struct gnutls_pkcs11_provider_st *prov=
ider)
+ {
+ p11_kit_module_finalize(provider->module);
+ p11_kit_module_release(provider->module);
+ gnutls_free(provider->init_args.reserved);
++ gnutls_free(provider->module_name);
+ }
+=20
+ static int pkcs11_provider_init(struct gnutls_pkcs11_provider_st *provide=
r,
+ struct ck_function_list *module,
+- const void *params)
++ const char *module_name, const void *params)
+ {
+ struct ck_c_initialize_args args;
+ const void *reserved =3D NULL;
+ ck_rv_t rv;
+- char *name;
+ char *p;
+=20
+- name =3D p11_kit_module_get_name(module);
+-
+- _gnutls_debug_log("p11: Initializing module: %s\n", name);
++ _gnutls_debug_log("p11: Initializing module: %s\n", module_name);
+=20
+ if (params && (p =3D strstr(params, "p11-kit:")) !=3D 0) {
+ reserved =3D (char *)(p + sizeof("p11-kit:") - 1);
+ }
+=20
+ /* First try with CKF_LIBRARY_CANT_CREATE_OS_THREADS |
+ * CKF_OS_LOCKING_OK, then fall back without it */
+@@ -298,39 +297,38 @@ static int pkcs11_provider_init(struct gnutls_pkcs11=
_provider_st *provider,
+ rv =3D module->C_Initialize(pargs);
+ }
+=20
+ if (rv !=3D CKR_OK) {
+ int ret;
+=20
+ gnutls_assert();
+- free(name);
+ ret =3D pkcs11_rv_to_err(rv);
+ assert(ret < 0);
+ return ret;
+ }
+=20
+ if (args.flags & CKF_OS_LOCKING_OK) {
+ _gnutls_debug_log(
+ "p11: Module %s is initialized in a thread-safe mode\n",
+- name);
++ module_name);
+ } else {
+ _gnutls_debug_log(
+ "p11: Module %s is initialized NOT in a thread-safe mode\n",
+- name);
++ module_name);
+ }
+- free(name);
+=20
+ if (args.reserved) {
+ args.reserved =3D gnutls_strdup((const char *)args.reserved);
+ if (!args.reserved)
+ return GNUTLS_E_MEMORY_ERROR;
+ }
+=20
+ memset(provider, 0, sizeof(*provider));
+ provider->module =3D module;
++ provider->module_name =3D gnutls_strdup(module_name);
+ provider->init_args =3D args;
+ if (p11_kit_module_get_flags(module) & P11_KIT_MODULE_TRUSTED ||
+ (params !=3D NULL && strstr(params, "trusted") !=3D 0))
+ provider->trusted =3D 1;
+=20
+ return 0;
+ }
+@@ -349,18 +347,16 @@ static int pkcs11_provider_add(const struct gnutls_p=
kcs11_provider_st *provider)
+ pkcs11_get_module_info(provider->module, &info);
+=20
+ /* initially check if this module is a duplicate */
+ for (i =3D 0; i < active_providers; i++) {
+ /* already loaded, skip the rest */
+ if (provider->module =3D=3D providers[i].module ||
+ memcmp(&info, &providers[i].info, sizeof(info)) =3D=3D 0) {
+- char *name =3D p11_kit_module_get_name(provider->module);
+ _gnutls_debug_log("p11: module %s is already loaded.\n",
+- name);
+- free(name);
++ provider->module_name);
+ return GNUTLS_E_INT_RET_0;
+ }
+ }
+=20
+ memcpy(&providers[active_providers], provider, sizeof(*provider));
+ memcpy(&providers[active_providers].info, &info, sizeof(info));
+ providers[active_providers].active =3D 1;
+@@ -496,15 +492,15 @@ int gnutls_pkcs11_add_provider(const char *name, con=
st char *params)
+ module =3D p11_kit_module_load(name, P11_KIT_MODULE_CRITICAL | flags);
+ if (module =3D=3D NULL) {
+ gnutls_assert();
+ _gnutls_debug_log("p11: Cannot load provider %s\n", name);
+ return GNUTLS_E_PKCS11_LOAD_ERROR;
+ }
+=20
+- ret =3D pkcs11_provider_init(&provider, module, params);
++ ret =3D pkcs11_provider_init(&provider, module, name, params);
+ if (ret !=3D 0) {
+ p11_kit_module_release(module);
+ gnutls_assert();
+ return ret;
+ }
+=20
+ ret =3D pkcs11_provider_add(&provider);
+@@ -1012,36 +1008,35 @@ static int auto_load(unsigned trusted)
+ _gnutls_debug_log("Cannot load registered modules: %s\n",
+ p11_kit_message());
+ return GNUTLS_E_PKCS11_LOAD_ERROR;
+ }
+=20
+ for (i =3D 0; modules[i] !=3D NULL; i++) {
+ struct gnutls_pkcs11_provider_st provider;
++ char *name =3D p11_kit_module_get_name(modules[i]);
+=20
+- ret =3D pkcs11_provider_init(&provider, modules[i], NULL);
++ ret =3D pkcs11_provider_init(&provider, modules[i], name, NULL);
+ if (ret < 0) {
+ gnutls_assert();
+- char *name =3D p11_kit_module_get_name(modules[i]);
+ _gnutls_debug_log(
+ "Cannot initialize PKCS #11 module: %s\n",
+ name);
+- free(name);
+- continue;
++ goto next;
+ }
+=20
+ ret =3D pkcs11_provider_add(&provider);
+ if (ret < 0) {
+ gnutls_assert();
+- char *name =3D p11_kit_module_get_name(provider.module);
+ _gnutls_debug_log("Cannot add PKCS #11 module: %s\n",
+ name);
+- free(name);
+ pkcs11_provider_deinit(&provider);
+- continue;
++ goto next;
+ }
++ next:
++ free(name);
+ }
+=20
+ /* Shallow free */
+ free(modules);
+ return 0;
+ }
+=20
+--=20
+2.53.0
+
diff -Nru gnutls28-3.8.9/debian/patches/series gnutls28-3.8.9/debian/patche=
s/series
--- gnutls28-3.8.9/debian/patches/series 2026-05-10 13:14:26.000000000 +0200
+++ gnutls28-3.8.9/debian/patches/series 2026-11-21 16:41:55.000000000 +0100
@@ -45,3 +45,10 @@
53_0022_gnutls-3.8.10-1823-cfg-clear-options.patch
53_0023_gnutls-3.8.10-1817-security-parameters.patch
53_0025__gnutls_pkcs7_unpad-add-missing-declaration.patch
+54_fix-tls-1.3-handshake.patch
+55_01_0001-_gnutls_pcert_to_auth_info-always-zeroize-cert-list-.patch
+55_01_0002-NEWS-add-an-entry-for-CVE-2026-127039.patch
+55_02_0001-rsa_psk.c-add-missing-return.patch
+55_02_0002-NEWS-add-an-entry-for-CVE-2026-127040.patch
+56-01-pkcs11-properly-fall-back-to-thread-unsafe-module-in.patch
+56-02-pkcs11-fix-module-name-resolution-for-unconfigured-m.patch
--9XrlL696LcAByNwT--
--VduLCJ3hQN+EpH9H
Content-Type: application/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE0uCSA5741Jbt9PpepU8BhUOCFIQFAmsC57QACgkQpU8BhUOC
FITgVg/8DlgEFTwysI8TLU4dFVjCMqPY4C4cRgCkFuIu41wwpr9kYpcR1KQ5M/sL
WcsHGItcukInxyqs09QoE/xRiPSTwOmg1G0/DY5fRSUc5QibALqrpDN4IsVJ63Ug
lKsDeiUS3Aa4nBagEiMxgVE38v2I5JjFOfzhc+/O7ZYhOWo0gYFgVzcf81E7hnQF
4RMDVWdLXTPLRBXGqJmYANwFFt5D+is4NWeMaiJJe9vIusZ7UIx/na67j1Qn8O9I
7KZHzhz1cg7x0Fg8xNdI7NmacGd/kqzcsashLSrCw3rajpLsvF/bpZDWbZ7O688M
SwvYL6jHz0bUw26wNABYu3D+HZ3tEjXllUtik7uWM22TSD8G9BuvcEUGjjjZMVVJ
iNCxWXKeZdPEl3DJsxpb5Ofmbvz/2MgengNa6iBbxczTY1wUzGjJUG7TdYAfgy6v
lAABgrV4ojyrHJ0XA+MoRYjizbobz6/LTFznFYWpihSzoIeb6rhx5ymESnH7rCH3
VqW71FDWQiE2Ee6rgFYoMRS9I6Tzg/zHsFqAfc7H2joMYrd3gh3bslkaccuIUQMK
08kEFSAVfmTe8o6alMA7vxBm7uyISV2OZjdDEBLMgVP3O5vE+Mg4uMLjUT4Q8kDp
MDXnw4aZ15cw3kDprFRb8GEzSJklPJLmpjIrPRDjlqZvhrS4/Xw=
=nLXs
-----END PGP SIGNATURE-----
--VduLCJ3hQN+EpH9H--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads