From: "plaisthos (Code Review)" Date: Mon, 27 Jan 2025 10:40:42 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <9f20b09154b8325fd1866a36ed62790ee6be5c63-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="vafyB+oo2Gs="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Remove comparing username to NULL in tls_lock_username List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --vafyB+oo2Gs= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello flichtenheld, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/871?usp=3Demail to look at the new patch set (#2). The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied= now. Change subject: Remove comparing username to NULL in tls_lock_username ...................................................................... Remove comparing username to NULL in tls_lock_username tls_lock_username is only called in a single place and that place calls this is function with up->username, which is always defined. Change-Id: Ib8adf7b31cae02e2de3d45da23b76a2d79f13e20 Signed-off-by: Arne Schwabe --- M src/openvpn/ssl_verify.c 1 file changed, 3 insertions(+), 6 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/71/871/2 diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c index 4c4b58d..e7d7ed6 100644 --- a/src/openvpn/ssl_verify.c +++ b/src/openvpn/ssl_verify.c @@ -153,11 +153,11 @@ { if (multi->locked_username) { - if (!username || strcmp(username, multi->locked_username)) + if (strcmp(username, multi->locked_username) !=3D 0) { msg(D_TLS_ERRORS, "TLS Auth Error: username attempted to chang= e from '%s' to '%s' -- tunnel disabled", multi->locked_username, - np(username)); + username); /* disable the tunnel */ tls_deauthenticate(multi); @@ -166,10 +166,7 @@ } else { - if (username) - { - multi->locked_username =3D string_alloc(username, NULL); - } + multi->locked_username =3D string_alloc(username, NULL); } return true; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/871?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ib8adf7b31cae02e2de3d45da23b76a2d79f13e20 Gerrit-Change-Number: 871 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newpatchset --vafyB+oo2Gs= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

plaisthos uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/871?usp=3Demail">View Chang= e

The change is no longer submittable: checks~ChecksSubmitRule is= unsatisfied now.

Remove comparing username to NULL in tls_lock_username
tls_lock_username is only called in a single place and that place
c= alls this is function with up->username, which is always defined.
Change-Id: Ib8adf7b31cae02e2de3d45da23b76a2d79f13e20
Signed-off-by: Arn= e Schwabe <arne@...1227...>
---
M src/openvpn/ssl_verify.c
1= file changed, 3 insertions(+), 6 deletions(-)

git pull ssh://ger=
rit.openvpn.net:29418/openvpn refs/changes/71/871/2
diff --git a/sr=
c/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c
index 4c4= b58d..e7d7ed6 100644
--- a/src/openvpn/ssl_verify.c<= br>+++ b/src/openvpn/ssl_verify.c
@@ -153,11 +153,11 = @@
{
if (multi->locked_username)
{
-= if (!username || strcmp(username, multi->locked_username))
+ if (strcmp(userna= me, multi->locked_username) !=3D 0)
{ msg(D_TLS_ERRORS, "TLS Auth Error: username attemp= ted to change from '%s' to '%s' -- tunnel disabled",
multi->locked_username,
- np(username));<= br>+ username);<= /span>

/* disable the tunnel */
tls_deauthenticate(multi);
@@ -16= 6,10 +166,7 @@
}
else
<= span> {

- if= (username)
- {<= /span>
- multi->= locked_username =3D string_alloc(username, NULL);
- }
+ multi->locked_username =3D string_alloc(userna= me, NULL);
}
return true;<= br> }

To view, visit change 871. To un= subscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib8adf7b31cae02e2de3d45da23b= 76a2d79f13e20
Gerrit-Change-Number: 871
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newpatchset
--vafyB+oo2Gs=--