From: "cron2 (Code Review)" Date: Mon, 17 Nov 2025 07:59:54 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="3KHSsquT0GA="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: ssl: Clean up type handling in parse_early_negotiation_tlvs() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --3KHSsquT0GA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#7) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1302?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: ssl: Clean up type handling in parse_early_negotiation_tlvs= () ...................................................................... ssl: Clean up type handling in parse_early_negotiation_tlvs() buf_read_u16 does not return uint16_t. Change-Id: Ie7ad637223c332f7611c09b20a8d7a3a92d97ec7 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1302 Message-Id: <20251116215433.29257-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 487.html Signed-off-by: Gert Doering --- M src/openvpn/ssl.c 1 file changed, 4 insertions(+), 13 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/02/1302/7 diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 4841837..8501693 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -2194,11 +2194,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /** * Handle reading key data, peer-info, username/password, OCC * from the TLS control channel (cleartext). @@ -2522,9 +2517,9 @@ goto error; } /* read type */ - uint16_t type =3D buf_read_u16(buf); - uint16_t len =3D buf_read_u16(buf); - if (buf_len(buf) < len) + int type =3D buf_read_u16(buf); + int len =3D buf_read_u16(buf); + if (type < 0 || len < 0 || buf_len(buf) < len) { goto error; } @@ -2536,7 +2531,7 @@ { goto error; } - uint16_t flags =3D buf_read_u16(buf); + int flags =3D buf_read_u16(buf); if (flags & EARLY_NEG_FLAG_RESEND_WKC) { @@ -3963,10 +3958,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void tls_prepend_opcode_v1(const struct tls_multi *multi, struct buffer *buf) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1302?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: Ie7ad637223c332f7611c09b20a8d7a3a92d97ec7 Gerrit-Change-Number: 1302 Gerrit-PatchSet: 7 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --3KHSsquT0GA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #7 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by cron2

ssl: Clean up type handling in pars=
e_early_negotiation_tlvs()

buf_read_u16 does not return uint16_t.
Change-Id: Ie7ad637223c332f7611c09b20a8d7a3a92d97ec7
Signed-off-by:= Frank Lichtenheld <frank@...2641...>
Acked-by: Gert Doering <g= ert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/13= 02
Message-Id: <20251116215433.29257-1-gert@...1296...>
URL: ht= tps://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34487.htm= l
Signed-off-by: Gert Doering <gert@...1296...>
---
M src/op= envpn/ssl.c
1 file changed, 4 insertions(+), 13 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/change=
s/02/1302/7
diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index 4841837..8501693 100644
--- a/src/openvpn= /ssl.c
+++ b/src/openvpn/ssl.c
@@ -2194,11 = +2194,6 @@
}
}

-#if defined(__GNUC__) || d= efined(__clang__)
-#pra= gma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
/**
* Handle readi= ng key data, peer-info, username/password, OCC
* from the= TLS control channel (cleartext).
@@ -2522,9 +2517,9 @@
goto error;
}
= /* read type */
- uint16_t type =3D buf_read_u16(buf);
- uint16_t len =3D buf_read_u16(buf);=
- if (buf_len(b= uf) < len)
+ = int type =3D buf_read_u16(buf);
+ int len =3D buf_read_u16(buf);
+ if (type < 0 || len < 0 || = buf_len(buf) < len)
{
= goto error;
}
@@ -2536,7 +2531= ,7 @@
{
= goto error;
}
- uint16_t flags =3D buf_read_u16= (buf);
+ = int flags =3D buf_read_u16(buf);

= if (flags & EARLY_NEG_FLAG_RESEND_WKC)
= {
@@ -3963,10 +3958,6 @@
= }
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
void
tls_pr= epend_opcode_v1(const struct tls_multi *multi, struct buffer *buf) {

To view, visit change 1302. To u= nsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie7ad637223c332f7611c09b20a8= d7a3a92d97ec7
Gerrit-Change-Number: 1302
Gerrit-PatchSet: 7
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>
= --3KHSsquT0GA=--