[Openvpn-devel,29/28] Add workaround for Softether server dropping P_ACK_V1 with >= 5 acks
| Message ID | 20220831134140.913337-2-arne@rfc2549.org |
|---|---|
| State | Accepted |
| Delegated to: | Gert Doering |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id WNGUBUdlD2MhOAAAIUCqbw (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 31 Aug 2022 09:42:31 -0400 Received: from proxy3.mail.ord1c.rsapps.net ([172.28.255.1]) by director10.mail.ord1d.rsapps.net with LMTP id gAlTBUdlD2NYKQAApN4f7A (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 31 Aug 2022 09:42:31 -0400 Received: from smtp21.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy3.mail.ord1c.rsapps.net with LMTPS id 0GoQBUdlD2PtUwAANIxBXg (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 31 Aug 2022 09:42:31 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp21.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: c1d2b336-2932-11ed-93b6-a0369f0d8808-1-1 Received: from [216.105.38.7] ([216.105.38.7:35772] helo=lists.sourceforge.net) by smtp21.gate.ord1c.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 22/5A-05315-5456F036; Wed, 31 Aug 2022 09:42:30 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1oTNyb-0007z1-Lo; Wed, 31 Aug 2022 13:41:53 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from <arne@kamera.blinkt.de>) id 1oTNya-0007yq-JI for openvpn-devel@lists.sourceforge.net; Wed, 31 Aug 2022 13:41:52 +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:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xg4y4FVLIHvZNkRTKd5QuHbrBQCKpefQR+avpBPxxps=; b=HGyjy2ZSdyPiXHjY5QPbWUdrFJ lRNCB2hSp63Lqc8wUQ50HxQEGUV2UA0Fl0S4Sls/6v3hCzbfIR4sxGw17RmabjNjyza3F28AOlQgl u0Hx+jmyvowLSFZgpW02WTBjJzsLh63bjvhaPDzjzxtC9VFAkSb9j2LmnYfZRXFccvI4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xg4y4FVLIHvZNkRTKd5QuHbrBQCKpefQR+avpBPxxps=; b=A/AV3mBV690k79Lh+sLHjxMtAv ROtDU2RmzwGgD50wD+lsYAA7R1FJ6hzhNLkRGxtZ97stQ+9dEjP3U0Rkv/YGcW4OMf7WKAZQut6aT SWf8iiSw3Ir3QN7tA7LZ5dTZVzLIKdS8Y+SJWjDGnno7C86SNdSKTKvChS19X1iEAJpI=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oTNya-008q84-1d for openvpn-devel@lists.sourceforge.net; Wed, 31 Aug 2022 13:41:52 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from <arne@kamera.blinkt.de>) id 1oTNyO-0001ig-5Q for openvpn-devel@lists.sourceforge.net; Wed, 31 Aug 2022 15:41:40 +0200 Received: (nullmailer pid 913388 invoked by uid 10006); Wed, 31 Aug 2022 13:41:40 -0000 From: Arne Schwabe <arne@rfc2549.org> To: openvpn-devel@lists.sourceforge.net Date: Wed, 31 Aug 2022 15:41:40 +0200 Message-Id: <20220831134140.913337-2-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220831134140.913337-1-arne@rfc2549.org> References: <20220422134038.3801239-1-arne@rfc2549.org> <20220831134140.913337-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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: Softether had the number of ACKs in ANY OpenVPN packet limited to 4 and dropped packets with more than 4 ACKs. This leads to Softether dropping P_ACK_V1 packets with more than 4 ACKs as invalid. As th [...] Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1oTNya-008q84-1d Subject: [Openvpn-devel] [PATCH 29/28] Add workaround for Softether server dropping P_ACK_V1 with >= 5 acks 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 |
| Series |
Stateless three-way handshake and control channel improvements
|
|
Commit Message
Arne Schwabe
Aug. 31, 2022, 3:41 a.m. UTC
Softether had the number of ACKs in ANY OpenVPN packet limited to 4 and
dropped packets with more than 4 ACKs. This leads to Softether dropping
P_ACK_V1 packets with more than 4 ACKs as invalid. As the recent change
of always acking as many packets as possible, this leads to Softether
server not being able to successfully establish a connection anymore as
it never registers the ACKs.
This behaviour has been fixed on the Softether side with commit 37aa1ba5
but in order to allow clients to connect to older Softether servers, this
commit implements a workaround for the case that the peer might be a
Softether server (no tls-auth/tls-crypt and no other advanced protocol
feature) and limits ACKs to 4 in this case.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
src/openvpn/ssl_pkt.c | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
Hi, On Wed, Aug 31, 2022 at 03:41:40PM +0200, Arne Schwabe wrote: > This behaviour has been fixed on the Softether side with commit 37aa1ba5 [..] > + * in a packet (see commit a14d812dcbc in Softether) */ The code seems to do what the commit says, but seeing two different commit IDs here confuses me. gert
Acked-by: Gert Doering <gert@greenie.muc.de> This is straightforward. The detection "what makes a softether server?" is a bit annoying... and this code will be with us forever... I have not specifically tested this ("no softether server around") but ran the normal server/client tests. Your patch has been applied to the master branch. commit 036517d5e06c1254233d51893b3a196a3cd37492 Author: Arne Schwabe Date: Wed Aug 31 15:41:40 2022 +0200 Add workaround for Softether server dropping P_ACK_V1 with >= 5 acks Signed-off-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20220831134140.913337-2-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25142.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
diff --git a/src/openvpn/ssl_pkt.c b/src/openvpn/ssl_pkt.c index e86fbc1b8..9b180cbf4 100644 --- a/src/openvpn/ssl_pkt.c +++ b/src/openvpn/ssl_pkt.c @@ -177,6 +177,15 @@ write_control_auth(struct tls_session *session, { uint8_t header = ks->key_id | (opcode << P_OPCODE_SHIFT); + /* Workaround for Softether servers. Softether has a bug that it only + * allows 4 ACks in packets and drops packets if more ACKs are contained + * in a packet (see commit a14d812dcbc in Softether) */ + if (session->tls_wrap.mode == TLS_WRAP_NONE && !session->opt->server + && !(session->opt->crypto_flags & CO_USE_TLS_KEY_MATERIAL_EXPORT)) + { + max_ack = min_int(max_ack, 4); + } + ASSERT(link_socket_actual_defined(&ks->remote_addr)); ASSERT(reliable_ack_write (ks->rec_ack, ks->lru_acks, buf, &ks->session_id_remote,