From: "cron2 (Code Review)" Date: Thu, 15 Jan 2026 09:39:04 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <204e2256f90731a5c5968cdc9cf8946d2f51f51d-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="dSgMFcKa5Lg="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: ssl_verify: Fix parsing of timeout from auth pending file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --dSgMFcKa5Lg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/14= 51?usp=3Demail ) Change subject: ssl_verify: Fix parsing of timeout from auth pending file ...................................................................... ssl_verify: Fix parsing of timeout from auth pending file Make sure the value is not negative before casting it to unsigned. Change-Id: I8a5efb2ed009a702f10dc8f40c677f014547b4c8 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1451 Message-Id: <20260115093235.25635-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 275.html Signed-off-by: Gert Doering --- M src/openvpn/ssl_verify.c 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c index a3ba66e..0b02a2f 100644 --- a/src/openvpn/ssl_verify.c +++ b/src/openvpn/ssl_verify.c @@ -874,11 +874,6 @@ return supported; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /** * Checks if the deferred state should also send auth pending * request to the client. Also removes the auth_pending control file @@ -888,7 +883,8 @@ * @returns false The file had an invlaid format or another error occured */ static bool -key_state_check_auth_pending_file(struct auth_deferred_status *ads, struct= tls_multi *multi, +key_state_check_auth_pending_file(struct auth_deferred_status *ads, + struct tls_multi *multi, struct tls_session *session) { bool ret =3D true; @@ -916,7 +912,7 @@ buf_chomp(extra_buf); long timeout =3D strtol(BSTR(timeout_buf), NULL, 10); - if (timeout =3D=3D 0) + if (timeout <=3D 0) { msg(M_WARN, "could not parse auth pending file timeout"); buffer_list_free(lines); @@ -933,14 +929,14 @@ pending_method); auth_set_client_reason(multi, buf); msg(M_INFO, - "Client does not supported auth pending method " - "'%s'", + "Client does not supported auth pending method '%s'", pending_method); ret =3D false; } else { - send_auth_pending_messages(multi, session, BSTR(extra_buf)= , timeout); + send_auth_pending_messages(multi, session, BSTR(extra_buf), + (unsigned int)timeout); } } @@ -950,10 +946,6 @@ return ret; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /** * Removes auth_pending and auth_control files from file system * and key_state structure -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1451?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I8a5efb2ed009a702f10dc8f40c677f014547b4c8 Gerrit-Change-Number: 1451 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --dSgMFcKa5Lg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

ssl_verify: Fix parsing of timeout from auth pen=
ding file

Make sure the value is not negative before casting
it t= o unsigned.

Change-Id: I8a5efb2ed009a702f10dc8f40c677f014547b4c8
= Signed-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Gert= Doering <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/= c/openvpn/+/1451
Message-Id: <20260115093235.25635-1-gert@...1296...&= gt;
URL: https://www.mail-archive.com/openvpn-devel@...475...= t/msg35275.html
Signed-off-by: Gert Doering <gert@...1296...>
-= --
M src/openvpn/ssl_verify.c
1 file changed, 6 insertions(+), 14 del= etions(-)

diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c<=
br>index a3ba66e..0b02a2f 100644
--- a/src/openvpn/ss= l_verify.c
+++ b/src/openvpn/ssl_verify.c
@= @ -874,11 +874,6 @@
return supported;
= }

-#= if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversio= n"
-#endif<= br>-
/**<= br> * Checks if the deferred state should also send auth pending
* request to the client. Also removes the auth_pending con= trol file
@@ -888,7 +883,8 @@
* @returns= false The file had an invlaid format or another error occured
<= span> */

static bool
-key_state_check_auth_pending_file(struct auth_deferred_sta= tus *ads, struct tls_multi *multi,
+key_state_check_auth_pending_file(struct auth_deferred_statu= s *ads,
+ = struct tls_multi *multi,
= struct tls_session *session)
{
bool ret =3D true;
@@ -916,7 +912,7 @@

buf_chomp(extra_buf);
long timeout =3D strtol(BSTR(timeout_buf), NULL, 10);
- if (timeout= =3D=3D 0)
+ = if (timeout <=3D 0)
{
= msg(M_WARN, "could not parse auth pending file timeout&= quot;);
buffer_list_free(lines);@@ -933,14 +929,14 @@
pend= ing_method);
auth_set_client_reason(multi,= buf);
msg(M_INFO,
- "Client does not s= upported auth pending method "
- "'%s'",
+ "Client do= es not supported auth pending method '%s'",

= pending_method);
ret = =3D false;
}
else=
{
- send_auth_pending_messages(multi, session, BSTR(e= xtra_buf), timeout);
= + send_auth_pending_messages(multi, session, BSTR(extra_buf)= ,
+ = (unsigned int)timeout);
= }
}

@@ -950,1= 0 +946,6 @@
return ret;
}
<= span>
-#if defined(__G= NUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
/**
* Removes auth_pending and auth_contr= ol files from file system
* and key_state structure

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

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8a5efb2ed009a702f10dc8f40c6= 77f014547b4c8
Gerrit-Change-Number: 1451
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --dSgMFcKa5Lg=--