From: "ralf_lici (Code Review)" Date: Mon, 16 Feb 2026 08:41:46 +0000 In-Reply-To: References: Reply-To: ralf@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <669aecf67481645b4c62a581012d7736cf13e49a-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="9OST89SUGzc="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: tls: reject incoming reneg request if primary key is not fully valid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --9OST89SUGzc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1478?usp=3Demail to look at the new patch set (#2). Change subject: tls: reject incoming reneg request if primary key is not fu= lly valid ...................................................................... tls: reject incoming reneg request if primary key is not fully valid An incoming P_CONTROL_SOFT_RESET_V1 can arrive while the primary key is already in S_GENERATED_KEYS but no longer fully authorized. This can happen when deferred auth later expires/fails, or when mid-session auth checks deauthenticate the key without demoting its TLS state. This patch keeps read_control_auth as the first gate, then rejects the incoming renegotiation request unless the primary key is KS_AUTH_TRUE and its auth_deferred_expire gate has passed. Change-Id: I704c560fa23c03237d0f8adc30908a617265a5a1 Signed-off-by: Ralf Lici --- M src/openvpn/ssl.c 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/78/1478/2 diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 69d0e4e..ce88478 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -3747,6 +3747,17 @@ goto error; } + /* + * Do not allow incoming renegotiation unless our primary key = is + * fully authenticated and past the deferred-auth/transition g= ate. + */ + if (ks->authenticated !=3D KS_AUTH_TRUE || now < ks->auth_defe= rred_expire) + { + msg(D_TLS_ERRORS, + "TLS Error: rejecting incoming renegotiation request: = key not fully authenticated/valid"); + goto error; + } + key_state_soft_reset(session); dmsg(D_TLS_DEBUG, "TLS: received P_CONTROL_SOFT_RESET_V1 s=3D%= d sid=3D%s", i, -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1478?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I704c560fa23c03237d0f8adc30908a617265a5a1 Gerrit-Change-Number: 1478 Gerrit-PatchSet: 2 Gerrit-Owner: ralf_lici Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --9OST89SUGzc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

ralf_lici uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/1478?usp=3Demail">View Chan= ge

tls: reject incoming reneg request if primary key i=
s not fully valid

An incoming P_CONTROL_SOFT_RESET_V1 can arrive whi= le the primary key is
already in S_GENERATED_KEYS but no longer fully au= thorized. This can
happen when deferred auth later expires/fails, or whe= n mid-session auth
checks deauthenticate the key without demoting its TL= S state.

This patch keeps read_control_auth as the first gate, then = rejects the
incoming renegotiation request unless the primary key is KS_= AUTH_TRUE
and its auth_deferred_expire gate has passed.

Change-Id= : I704c560fa23c03237d0f8adc30908a617265a5a1
Signed-off-by: Ralf Lici <= ;ralf@...2726...>
---
M src/openvpn/ssl.c
1 file changed, 11 in= sertions(+), 0 deletions(-)

git pull ssh://gerri=
t.openvpn.net:29418/openvpn refs/changes/78/1478/2
diff --git a/src=
/openvpn/ssl.c b/src/openvpn/ssl.c
index 69d0e4e..ce88478 1= 00644
--- a/src/openvpn/ssl.c
+++ b/src/ope= nvpn/ssl.c
@@ -3747,6 +3747,17 @@
= goto error;
}
=
+ /*
<= span style=3D"color: hsl(120, 100%, 40%);">+ * Do not allow inc= oming renegotiation unless our primary key is
+ * fully authenticated and past the d= eferred-auth/transition gate.
+ */
+ if (ks->authenticated !=3D KS_AUTH_TRUE || now < ks= ->auth_deferred_expire)
+ {
= + msg(D_TLS_ERRORS,
+ "TLS Error: rejecting incoming rene= gotiation request: key not fully authenticated/valid");
+ goto error;=
+ }
+
ke= y_state_soft_reset(session);

= dmsg(D_TLS_DEBUG, "TLS: received P_CONTROL_SOFT_RESET_V1 s=3D%d sid= =3D%s", i,

To view, visit change 1478= . To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I704c560fa23c03237d0f8adc309= 08a617265a5a1
Gerrit-Change-Number: 1478
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --9OST89SUGzc=--