Skip to content

Commit 24bb3db

Browse files
Patch gnutls for CVE-2025-6395
1 parent ce11436 commit 24bb3db

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed

SPECS/gnutls/CVE-2025-6395.patch

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
From 78e380175a09ab2bdacc03bfe45ec4dcd15ee01b Mon Sep 17 00:00:00 2001
2+
From: Azure Linux Security Servicing Account
3+
4+
Date: Tue, 15 Jul 2025 20:08:47 +0000
5+
Subject: [PATCH] Fix CVE CVE-2025-6395 in gnutls
6+
7+
Upstream Patch Reference: https://gitlab.com/gnutls/gnutls/-/commit/23135619773e6ec087ff2abc65405bd4d5676bad.patch
8+
---
9+
lib/handshake.c | 25 ++++++++++++++++++++++---
10+
lib/state.c | 4 +++-
11+
2 files changed, 25 insertions(+), 4 deletions(-)
12+
13+
diff --git a/lib/handshake.c b/lib/handshake.c
14+
index 722307b..489d021 100644
15+
--- a/lib/handshake.c
16+
+++ b/lib/handshake.c
17+
@@ -589,9 +589,28 @@ static int set_auth_types(gnutls_session_t session)
18+
/* Under TLS1.3 this returns a KX which matches the negotiated
19+
* groups from the key shares; if we are resuming then the KX seen
20+
* here doesn't match the original session. */
21+
- if (!session->internals.resumed)
22+
- kx = gnutls_kx_get(session);
23+
- else
24+
+ if (!session->internals.resumed) {
25+
+ const gnutls_group_entry_st *group = get_group(session);
26+
+
27+
+ if (session->internals.hsk_flags & HSK_PSK_SELECTED) {
28+
+ if (group) {
29+
+ kx = group->pk == GNUTLS_PK_DH ?
30+
+ GNUTLS_KX_DHE_PSK :
31+
+ GNUTLS_KX_ECDHE_PSK;
32+
+ } else {
33+
+ kx = GNUTLS_KX_PSK;
34+
+ }
35+
+ } else if (group) {
36+
+ /* Not necessarily be RSA, but just to
37+
+ * make _gnutls_map_kx_get_cred below
38+
+ * work.
39+
+ */
40+
+ kx = group->pk == GNUTLS_PK_DH ?
41+
+ GNUTLS_KX_DHE_RSA :
42+
+ GNUTLS_KX_ECDHE_RSA;
43+
+ } else
44+
+ kx = GNUTLS_KX_UNKNOWN;
45+
+ } else
46+
kx = GNUTLS_KX_UNKNOWN;
47+
} else {
48+
/* TLS1.2 or earlier, kx is associated with ciphersuite */
49+
diff --git a/lib/state.c b/lib/state.c
50+
index ec514c0..10ec0ea 100644
51+
--- a/lib/state.c
52+
+++ b/lib/state.c
53+
@@ -202,7 +202,8 @@ gnutls_kx_algorithm_t gnutls_kx_get(gnutls_session_t session)
54+
const gnutls_group_entry_st *group = get_group(session);
55+
56+
if (ver->tls13_sem) {
57+
- if (session->internals.hsk_flags & HSK_PSK_SELECTED) {
58+
+ if (gnutls_auth_client_get_type(session) ==
59+
+ GNUTLS_CRD_PSK) {
60+
if (group) {
61+
if (group->pk == GNUTLS_PK_DH)
62+
return GNUTLS_KX_DHE_PSK;
63+
@@ -349,6 +350,7 @@ void reset_binders(gnutls_session_t session)
64+
_gnutls_free_temp_key_datum(&session->key.binders[0].psk);
65+
_gnutls_free_temp_key_datum(&session->key.binders[1].psk);
66+
memset(session->key.binders, 0, sizeof(session->key.binders));
67+
+ session->internals.hsk_flags &= ~HSK_PSK_SELECTED;
68+
}
69+
70+
/* Check whether certificate credentials of type @cert_type are set
71+
--
72+
2.45.3
73+

SPECS/gnutls/gnutls.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: The GnuTLS Transport Layer Security Library
22
Name: gnutls
33
Version: 3.8.3
4-
Release: 4%{?dist}
4+
Release: 5%{?dist}
55
License: GPLv3+ AND LGPLv2.1+
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -14,6 +14,7 @@ Patch1: CVE-2024-28834.patch
1414
Patch2: CVE-2024-28835.patch
1515
Patch3: CVE-2024-12133.patch
1616
Patch4: CVE-2024-12243.patch
17+
Patch5: CVE-2025-6395.patch
1718
BuildRequires: autogen-libopts-devel
1819
BuildRequires: gc-devel
1920
BuildRequires: libtasn1-devel
@@ -95,6 +96,9 @@ sed -i 's/TESTS += test-ciphers-openssl.sh//' tests/slow/Makefile.am
9596
%{_mandir}/man3/*
9697

9798
%changelog
99+
* Tue Jul 15 2025 Azure Linux Security Servicing Account <[email protected]> - 3.8.3-5
100+
- Patch for CVE-2025-6395
101+
98102
* Tue Mar 11 2025 Sreeniavsulu Malavathula <[email protected]> - 3.8.3-4
99103
- Patch CVE-2024-12243
100104

0 commit comments

Comments
 (0)