| Message ID | 20241023134903.66485-1-rzvncj@gmail.com |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7000:6bd6:b0:5b9:581e:f939 with SMTP id c22csp405408max;
Wed, 23 Oct 2024 06:49:12 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AJvYcCWRxUnZqaSU/dg6n5gelNkCZx75N3qaJ8GL79T4pqSCXTtMjPBP/KgvhUR0D1DDMqYFRlSSKyV13Z0=@openvpn.net
X-Google-Smtp-Source:
AGHT+IFD0Fdo3A88E0x02SdCpiThA1QUNdT0sG7iW5hgI7sHwJglnpi0ntEmCZpT02uVR+20sODZ
X-Received: by 2002:a05:6870:96a6:b0:288:6d7e:2e19 with SMTP id
586e51a60fabf-28ccb39a50fmr3086436fac.10.1729691352586;
Wed, 23 Oct 2024 06:49:12 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1729691352; cv=none;
d=google.com; s=arc-20240605;
b=jqJdbZS3t5AsDHcxkkEup704myIppdYapr9SW7DDu3GoS8a4MV+0wLydrWHos2qhI3
wddSV0HuhQb4LtC9CgAjLWlO6AHZpFTGNo9S7OT6TJmjDRqXJxbr0CPAv+hwFJZ4coHe
DMf5nD1GhOUlXc/1RyferokrDKlsrv+sDprjl18beMqXtLEPJAyWwOi7guZfAX/37etw
Bo5Nf/r47MpqBR3E6D82ow9T+EOJB9/m1inoGPhwu2oxNwF1QPnLz6DBCICPK9nNm7BP
GEZRw3lc/vFr6KmC4xuoj8jrs2QqLgBuLsFOapyEqOV9ijMwQH5Sik6sxq+KHrP/6d7y
AcIg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=errors-to:content-transfer-encoding:list-subscribe:list-help
:list-post:list-archive:list-unsubscribe:list-id:precedence:subject
:mime-version:message-id:date:to:from:dkim-signature:dkim-signature
:dkim-signature;
bh=C2Tk958qA6YVpQizc4VNQ4Xngb75SXfD4MRYow6RRWU=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=efN7DWRA3H3GIAsN6cEBnZoLRmI6Yo7GAn2VLEOzjSb1VM4rmm9VtzrjdTQQyq4eQI
C6RxblyoDx67eSV/Aax4sNw6ZAMrL3N9UXmCN1y8n11b4rqckNxMqBm+EYMSMqPXLSja
/EsjifLp4fDVztfzJjMxkiZYoWrAcvLLQtxRyUAyFRSSZy/wIsad89zhEGLNi/ke+tHo
2R9+QECBImJT/nk/uwocnq9h1GOJJGzAn76UP0W7Ib3TqmlRd3pZL54oS68oZRvILfvQ
sOI3nFt2WKwCbr+ElwsCOU0G/lW2DWHhpkaVvLVU/hOhKsv+cobwao61dbmPBCXdRNJr
KjqQ==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=PwQSqVeP;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b="dh/PVLcJ";
dkim=neutral (body hash did not verify) header.i=@gmail.com
header.s=20230601 header.b=avRXTGGi;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
dara=fail header.i=@openvpn.net
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
586e51a60fabf-28c793e2ed9si4347583fac.162.2024.10.23.06.49.12
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Wed, 23 Oct 2024 06:49:12 -0700 (PDT)
Received-SPF: pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) client-ip=216.105.38.7;
Authentication-Results: mx.google.com;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=PwQSqVeP;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b="dh/PVLcJ";
dkim=neutral (body hash did not verify) header.i=@gmail.com
header.s=20230601 header.b=avRXTGGi;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
dara=fail header.i=@openvpn.net
Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com)
by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1t3bjR-0006Wy-OT;
Wed, 23 Oct 2024 13:49:01 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95)
(envelope-from <rzvncj@gmail.com>) id 1t3bjQ-0006Wo-KG
for openvpn-devel@lists.sourceforge.net;
Wed, 23 Oct 2024 13:49:00 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID:
Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=hql+TH+AabuCM8FI0sdWhW9a5Ewm+xj13Y2BuJwR7dI=; b=PwQSqVePcWGJtfuefuhnUUq2XO
AiCUeeb3NfrHseufDtJjdHTaLtdPa58b/SWvPbnWihiF3UhZNVgOcOAhnakC0EJhwBawunIwquIzl
wApIs8QtPTyvBBYVv6LB+x3xtXsspsa22AcTr+F0xfg9lpoc6oQQxRMylzSuApCuBr3A=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From
:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:
Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:
References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:
List-Owner:List-Archive; bh=hql+TH+AabuCM8FI0sdWhW9a5Ewm+xj13Y2BuJwR7dI=; b=d
h/PVLcJlSj4NiR9G8HqUvC9Zqk0a9yVr9lsUKwxSLwqSHG2HnH+/VStIDDGGzqxZG8sFYnD17lI7V
VdHnQyASX/OV6NKWUHlJ48rVFsWU8cCNDy5pVPCzE1dVFC5ABl7at52CQx2O3S1qfSIp/+312A0cQ
f3ZFNzvn7HDCXlY0=;
Received: from mail-wr1-f47.google.com ([209.85.221.47])
by sfi-mx-2.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95)
id 1t3bjP-0004ns-FU for openvpn-devel@lists.sourceforge.net;
Wed, 23 Oct 2024 13:48:59 +0000
Received: by mail-wr1-f47.google.com with SMTP id
ffacd0b85a97d-37ec4e349f4so4039998f8f.0
for <openvpn-devel@lists.sourceforge.net>;
Wed, 23 Oct 2024 06:48:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1729691328; x=1730296128;
darn=lists.sourceforge.net;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=hql+TH+AabuCM8FI0sdWhW9a5Ewm+xj13Y2BuJwR7dI=;
b=avRXTGGizHkDrsz1KBI3tdmMxtl675JFdun4mUpJu/Z3oCFxtJvdWQiXDdQc8KV+68
IWDTNvePwPmM/Xrrx0XDHkeQkZv7JYpV8VnJS+uTScGq+ftSdQDtJ0m08QvKRwCyHQq0
q86nD2507oWl1A5ri3r4YKKvAmuiq6rFsr8sC6ce635cdGjFFFsByPa2gwLScZtKq+rB
pFQdsWnMj2eOtU8+LG+IkxCRYGyI3DT966uBnKRW8RFEGykA1lcoUcRETzMVhrix3S5a
3cq+e4mi2bNh3yM5RCk8FApAg7yErKgDt45wI+YXZragWfqkaMGzQ7UO/r830eN2EZy8
kVlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1729691328; x=1730296128;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=hql+TH+AabuCM8FI0sdWhW9a5Ewm+xj13Y2BuJwR7dI=;
b=VK7bx85J0kMmWA662lnYPD5Can6Y5XT2urYAIx6hab73VE8f2QOalTPwwynoONXSCF
P9/NF93JgXr1rPGBS0+eKQumvOBdxrTOokE6AaTXoD1hSnI8KDxPmHU6LmGxwUFjy1LS
Klg2gZxV17hxaZf4kQN1Ioy2o+FD5TayqcTPWSpUYBwbS5V1wYwNDuwXcSQZXZ5Wlekv
z7cuaIXmzuv/gEpiC6tLKOubL05Wsbh7wZEFScTLCcf1AY/RwpQvBmt22ilr+OZUj2qD
4GGNTpXENSzpRtfPVPyiI56VUs8wDc5g6oLo3FTkjuLFTP/EDTMBlprEFS/M8nXzTiXn
D/Jg==
X-Gm-Message-State: AOJu0YyFCz4JJMSOK32bXOEO6Que2RNUdGsd0DdnhTJaFXEnrxQWMAhM
kw0Qi6h/fj/odQPdKh9wILlCrOgVc/Cd3SwkWzCWPIT/C4FNNFnSGRDarjRz
X-Received: by 2002:adf:fa50:0:b0:37d:4cee:55b with SMTP id
ffacd0b85a97d-37efcfb7ec6mr1802669f8f.59.1729691327780;
Wed, 23 Oct 2024 06:48:47 -0700 (PDT)
Received: from localhost.localdomain ([188.27.87.77])
by smtp.gmail.com with ESMTPSA id
ffacd0b85a97d-37ee0b9cd48sm8939960f8f.111.2024.10.23.06.48.47
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 23 Oct 2024 06:48:47 -0700 (PDT)
From: Razvan Cojocaru <rzvncj@gmail.com>
To: openvpn-devel@lists.sourceforge.net
Date: Wed, 23 Oct 2024 16:49:03 +0300
Message-ID: <20241023134903.66485-1-rzvncj@gmail.com>
X-Mailer: git-send-email 2.47.0
MIME-Version: 1.0
X-Spam-Score: -0.9 (/)
X-Spam-Report: Spam detection software,
running on the system "util-spamd-2.v13.lw.sourceforge.com",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: This in turn allows the server to signal to the client that
it should no longer attempt to reconnect, if it wants to keep the client
out after an AUTH_FAILED. Signed-off-by: Razvan Cojocaru ---
src/openvpn/misc.c | 5 +++++ 1 file changed, 5 insertions(+)
Content analysis details: (-0.9 points, 6.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
1.0 HK_RANDOM_FROM From username looks random
0.0 HK_RANDOM_ENVFROM Envelope sender username looks random
0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
provider [rzvncj[at]gmail.com]
-0.0 SPF_PASS SPF: sender matches SPF record
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
envelope-from domain
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
author's domain
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily
valid
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,
no trust [209.85.221.47 listed in list.dnswl.org]
-1.7 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2)
[209.85.221.47 listed in wl.mailspike.net]
X-Headers-End: 1t3bjP-0004ns-FU
Subject: [Openvpn-devel] [PATCH] Allow setting an empty auth-token in push
replies
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: =?utf-8?q?1813712839512226929?=
X-GMAIL-MSGID: =?utf-8?q?1813712839512226929?=
|
| Series |
[Openvpn-devel] Allow setting an empty auth-token in push replies
|
|
Commit Message
Razvan Cojocaru
Oct. 23, 2024, 1:49 p.m. UTC
This in turn allows the server to signal to the client that it
should no longer attempt to reconnect, if it wants to keep the
client out after an AUTH_FAILED.
Signed-off-by: Razvan Cojocaru <rzvncj@gmail.com>
---
src/openvpn/misc.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
Hi, On Wed, Oct 23, 2024 at 04:49:03PM +0300, Razvan Cojocaru wrote: > This in turn allows the server to signal to the client that it > should no longer attempt to reconnect, if it wants to keep the > client out after an AUTH_FAILED. This should not be necessary. After an AUTH_FAILED the token is already invalidated on the client side. Can you describe your use case a bit better? This code is complex enough as it is, so I'm not really willing to add more cases to it (which I do have to test then and forever) if not needed. gert
On 10/23/24 17:23, Gert Doering wrote: > Hi, > > On Wed, Oct 23, 2024 at 04:49:03PM +0300, Razvan Cojocaru wrote: >> This in turn allows the server to signal to the client that it >> should no longer attempt to reconnect, if it wants to keep the >> client out after an AUTH_FAILED. > > This should not be necessary. After an AUTH_FAILED the token is > already invalidated on the client side. > > Can you describe your use case a bit better? This code is complex > enough as it is, so I'm not really willing to add more cases to it > (which I do have to test then and forever) if not needed. Thanks for the quick reply! Of course! The use case pertains to the device posture checks that OpenVPN has rolled out. Long story short, these are meant to allow the server to make decisions on whether the client is allowed to connect (and stay connected, which is the part I'm addressing here) based on information about it. For example, if it has an up-to-date antivirus, or if it has full disk encryption enabled. So a client may connect and be allowed in, then for some reason its antivirus may not be updated for a considerable while, at which point a check will want to disconnect said client. Reconnects will be possible after whoever manages the client machine updates the antivirus. In this case, we want to disconnect the client and it should stay disconnected. A simple AUTH_FAILED for this scenario will have the client attempt another connection. But if we invalidate the token, then the client will not attempt to reconnect. Another reason for this patch is that the OpenVPN 3 client does allow setting the auth-token to an empty string, and when it is empty the logic is to not reconnect - so this would allow both version 2 and version 3 clients to behave the same way. Thanks, Razvan
Hi, On Wed, Oct 23, 2024 at 05:40:43PM +0300, Razvan Cojocaru wrote: > In this case, we want to disconnect the client and it should stay > disconnected. A simple AUTH_FAILED for this scenario will have the client > attempt another connection. But if we invalidate the token, then the client > will not attempt to reconnect. AUTH_FAILED should do this automatically - invalidate the token, that is. Can you show a log where this is (not) happening? gert
On 10/23/24 17:43, Gert Doering wrote: > Hi, > > On Wed, Oct 23, 2024 at 05:40:43PM +0300, Razvan Cojocaru wrote: >> In this case, we want to disconnect the client and it should stay >> disconnected. A simple AUTH_FAILED for this scenario will have the client >> attempt another connection. But if we invalidate the token, then the client >> will not attempt to reconnect. > > AUTH_FAILED should do this automatically - invalidate the token, that is. > Can you show a log where this is (not) happening? Of course: 2024-10-23 14:52:06 us=368754 PUSH: Received control message: 'PUSH_REPLY,auth-token' 2024-10-23 14:52:06 us=368851 UDPv4 WRITE [90] to [AF_INET]69.162.107.71:1194: P_ACK_V1 kid=0 pid=[ #13 ] [ 8 7 6 5 4 3 2 1 ] DATA len=0 2024-10-23 14:52:06 us=368936 UDPv4 READ [163] from [AF_INET]69.162.107.71:1194: P_CONTROL_V1 kid=0 pid=[ #12 ] [ 2 3 4 5 ] pid=9 DATA len=85 2024-10-23 14:52:06 us=368972 AUTH: Received control message: AUTH_FAILED,No Stairway to Heaven allowed in this guitar store 2024-10-23 14:52:06 us=369228 TCP/UDP: Closing socket 2024-10-23 14:52:06 us=369287 SIGUSR1[soft,auth-failure (auth-token)] received, process restarting 2024-10-23 14:52:06 us=369346 Restart pause, 1 second(s) And with this patch: 2024-10-23 17:46:58 us=427109 PUSH: Received control message: 'PUSH_REPLY,auth-token' 2024-10-23 17:46:58 us=427149 UDPv4 WRITE [90] to [AF_INET]69.162.107.71:1194: P_ACK_V1 kid=0 pid=[ #12 ] [ 8 7 6 5 4 3 2 1 ] DATA len=0 2024-10-23 17:46:58 us=427371 UDPv4 READ [163] from [AF_INET]69.162.107.71:1194: P_CONTROL_V1 kid=0 pid=[ #12 ] [ 2 3 4 5 ] pid=9 DATA len=85 2024-10-23 17:46:58 us=427403 AUTH: Received control message: AUTH_FAILED,No Stairway to Heaven allowed in this guitar store 2024-10-23 17:46:58 us=427414 register signal: SIGTERM (auth-failure) 2024-10-23 17:46:58 us=427427 SIGTERM received, sending exit notification to peer 2024-10-23 17:46:58 us=427442 signal_reset: signal UNKNOWN is cleared 2024-10-23 17:46:58 us=427464 UDPv4 WRITE [90] to [AF_INET]69.162.107.71:1194: P_ACK_V1 kid=0 pid=[ #13 ] [ 9 8 7 6 5 4 3 2 ] DATA len=0 2024-10-23 17:46:58 us=427501 UDPv4 WRITE [41] to [AF_INET]69.162.107.71:1194: P_DATA_V2 kid=0 DATA len=40 2024-10-23 17:46:59 us=679084 register signal: SIGTERM (exit-with-notification) 2024-10-23 17:46:59 us=679264 TCP/UDP: Closing socket 2024-10-23 17:46:59 us=679300 net_route_v4_del: 100.96.0.0/11 via 100.96.1.1 dev [NULL] table 0 metric -1 2024-10-23 17:46:59 us=679388 sitnl_send: checking for received messages 2024-10-23 17:46:59 us=679406 sitnl_send: rtnl: received 36 bytes 2024-10-23 17:46:59 us=679437 net_route_v4_del: 100.80.0.0/12 via 100.96.1.1 dev [NULL] table 0 metric -1 2024-10-23 17:46:59 us=679477 sitnl_send: checking for received messages 2024-10-23 17:46:59 us=679500 sitnl_send: rtnl: received 36 bytes 2024-10-23 17:46:59 us=679519 delete_route_ipv6(fd:0:0:8000::/49) 2024-10-23 17:46:59 us=679531 net_route_v6_del: fd:0:0:8000::/49 via :: dev tun1 table 0 metric -1 2024-10-23 17:46:59 us=679618 sitnl_send: checking for received messages 2024-10-23 17:46:59 us=679639 sitnl_send: rtnl: received 36 bytes 2024-10-23 17:46:59 us=679663 delete_route_ipv6(fd:0:0:4000::/50) 2024-10-23 17:46:59 us=679678 net_route_v6_del: fd:0:0:4000::/50 via :: dev tun1 table 0 metric -1 2024-10-23 17:46:59 us=679743 sitnl_send: checking for received messages 2024-10-23 17:46:59 us=679763 sitnl_send: rtnl: received 36 bytes 2024-10-23 17:46:59 us=679801 Closing tun/tap interface 2024-10-23 17:46:59 us=679817 net_addr_v4_del: 100.96.1.2 dev tun1 2024-10-23 17:46:59 us=679930 sitnl_send: checking for received messages 2024-10-23 17:46:59 us=679976 sitnl_send: rtnl: received 36 bytes 2024-10-23 17:46:59 us=679997 net_addr_v6_del: fd:0:0:8100::2/64 dev tun1 2024-10-23 17:46:59 us=680107 sitnl_send: checking for received messages 2024-10-23 17:46:59 us=680129 sitnl_send: rtnl: received 36 bytes 2024-10-23 17:46:59 us=725831 SIGTERM[soft,exit-with-notification] received, process exiting Thanks, Razvan
Hi, On Wed, Oct 23, 2024 at 05:47:51PM +0300, Razvan Cojocaru wrote: > > AUTH_FAILED should do this automatically - invalidate the token, that is. > > Can you show a log where this is (not) happening? > > Of course: > > 2024-10-23 14:52:06 us=368754 PUSH: Received control message: > 'PUSH_REPLY,auth-token' > 2024-10-23 14:52:06 us=368851 UDPv4 WRITE [90] to > [AF_INET]69.162.107.71:1194: P_ACK_V1 kid=0 pid=[ #13 ] [ 8 7 6 5 4 3 2 1 ] > DATA len=0 > 2024-10-23 14:52:06 us=368936 UDPv4 READ [163] from > [AF_INET]69.162.107.71:1194: P_CONTROL_V1 kid=0 pid=[ #12 ] [ 2 3 4 5 ] > pid=9 DATA len=85 > 2024-10-23 14:52:06 us=368972 AUTH: Received control message: AUTH_FAILED,No > Stairway to Heaven allowed in this guitar store > 2024-10-23 14:52:06 us=369228 TCP/UDP: Closing socket > 2024-10-23 14:52:06 us=369287 SIGUSR1[soft,auth-failure (auth-token)] > received, process restarting > 2024-10-23 14:52:06 us=369346 Restart pause, 1 second(s) OK, so I see what is happening - you're sending an AUTH_FAILED "out of the blue", not in response to a client handshake, right? OpenVPN 2 *should* invalidate the token upon the reconnect (and then getting an AUTH_FAILED)... so what happens in this case if you let it reconnect? gert
On 10/23/24 17:50, Gert Doering wrote: > OK, so I see what is happening - you're sending an AUTH_FAILED "out of > the blue", not in response to a client handshake, right? Exactly. In response to a client handshake there's no problem. > OpenVPN 2 *should* invalidate the token upon the reconnect (and then > getting an AUTH_FAILED)... so what happens in this case if you let it > reconnect? If we let it reconnect, the first re-connection attempt will fail at the handshake stage as expected. But OpenVPN GUI tools will tend to show _two_ failed connections (the first "out of the blue" AUTH_FAILED one, and the second actual one), which is confusing for clients. Thanks, Razvan
On Wed, Oct 23, 2024 at 11:03 AM Razvan Cojocaru <rzvncj@gmail.com> wrote: > On 10/23/24 17:50, Gert Doering wrote: > > OK, so I see what is happening - you're sending an AUTH_FAILED "out of > > the blue", not in response to a client handshake, right? > > Exactly. In response to a client handshake there's no problem. > > > OpenVPN 2 *should* invalidate the token upon the reconnect (and then > > getting an AUTH_FAILED)... so what happens in this case if you let it > > reconnect? > > If we let it reconnect, the first re-connection attempt will fail at the > handshake stage as expected. > > But OpenVPN GUI tools will tend to show _two_ failed connections (the > first "out of the blue" AUTH_FAILED one, and the second actual one), > which is confusing for clients. > Wouldn't pushing "HALT" instead of "AUTH_FAILED" work in this case? As in the management command "client-kill {cid} HALT" which calls send_restart() with kill_msg = "HALT". Selva
On 10/23/24 18:25, Selva Nair wrote: > Wouldn't pushing "HALT" instead of "AUTH_FAILED" work in this case? > As in the management command "client-kill {cid} HALT" which calls > send_restart() with kill_msg = "HALT". Possibly, however the intent has always been to use this feature to reject (authorize) clients (so this is a corner case of that, just that we can retract authorization at a later time), and in addition considerable work has already been done that relies on the AUTH_FAILED code paths. Thanks, Razvan
On Wed, Oct 23, 2024 at 11:47 AM Razvan Cojocaru <rzvncj@gmail.com> wrote: > On 10/23/24 18:25, Selva Nair wrote: > > Wouldn't pushing "HALT" instead of "AUTH_FAILED" work in this case? > > As in the management command "client-kill {cid} HALT" which calls > > send_restart() with kill_msg = "HALT". > > Possibly, however the intent has always been to use this feature to > reject (authorize) clients (so this is a corner case of that, just that > we can retract authorization at a later time), and in addition > considerable work has already been done that relies on the AUTH_FAILED > code paths. > > Looks like a misuse of AUTH_FAILED to me. To kill a client while not in the authentication phase, use code paths meant for that purpose. Selva
diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c index 70ba5e4d..82ac8056 100644 --- a/src/openvpn/misc.c +++ b/src/openvpn/misc.c @@ -524,6 +524,11 @@ set_auth_token(struct user_pass *tk, const char *token) } protect_user_pass(tk); } + else + { + tk->defined = false; + tk->token_defined = false; + } } void