From: "flichtenheld (Code Review)" Date: Fri, 19 Dec 2025 14:23:30 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <720edc163352e9f1fb3f349dd5701894a85ed473-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="NxE18poGBsk="; 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: plaisthos Cc: openvpn-devel --NxE18poGBsk= 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 do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1451?usp=3Demail to review the following change. 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 --- M src/openvpn/ssl_verify.c 1 file changed, 6 insertions(+), 14 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/51/1451/1 diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c index a11003c..5effa2c 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: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I8a5efb2ed009a702f10dc8f40c677f014547b4c8 Gerrit-Change-Number: 1451 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --NxE18poGBsk= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

ssl_verify: Fix parsing of timeout from aut=
h pending file

Make sure the value is not negative before castingit to unsigned.

Change-Id: I8a5efb2ed009a702f10dc8f40c677f014547b4c= 8
Signed-off-by: Frank Lichtenheld <frank@...2641...>
---
M = src/openvpn/ssl_verify.c
1 file changed, 6 insertions(+), 14 deletions(-= )

git pull ssh://gerrit.openvpn.net:29418/openvp=
n refs/changes/51/1451/1
diff --git a/src/openvpn/ssl_verify.c b/sr=
c/openvpn/ssl_verify.c
index a11003c..5effa2c 100644=
--- a/src/openvpn/ssl_verify.c
+++ b/src/openvpn/= ssl_verify.c
@@ -874,11 +874,6 @@
retu= rn supported;
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic p= ush
-#pragma GCC diagno= stic ignored "-Wconversion"
-#endif
= -
/**
* Checks if the deferred state sh= ould also send auth pending
* request to the client. Als= o removes the auth_pending control file
@@ -888,7 +883,8 @@=
* @returns false The file had an invlaid format or ano= ther error occured
*/
static bool=
-key_state_check_auth_pending= _file(struct auth_deferred_status *ads, struct tls_multi *multi,
= +key_state_check_auth_pending_f= ile(struct auth_deferred_status *ads,
+ struct tls_multi *multi= ,
struct tls_session *se= ssion)
{
bool ret =3D true;@@ -916,7 +912,7 @@
buf_chomp(extra_buf= );

long timeout =3D strtol(B= STR(timeout_buf), NULL, 10);
- if (timeout =3D=3D 0)
+ if (timeout <=3D 0)
= {
msg(M_WARN, "could not pa= rse auth pending file timeout");
buff= er_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 "
<= span style=3D"color: hsl(0, 100%, 40%);">- "'%s= '",

+ = "Client does not supported auth pending method '%s= 9;",
pending_method);
<= span> ret =3D false;
}<= br> else
{
- send_auth_pending_messa= ges(multi, session, BSTR(extra_buf), timeout);
+ send_auth_pending_messages(multi= , session, BSTR(extra_buf),
+ (unsigned int)timeout);<= /span>
}
}
=
@@ -950,10 +946,6 @@
return ret;
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif

-
/**
* Removes a= uth_pending and auth_control files from file system
* an= d key_state structure

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8a5efb2ed009a702f10dc8f40c6= 77f014547b4c8
Gerrit-Change-Number: 1451
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --NxE18poGBsk=--