From patchwork Fri Aug 5 05:08:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2633 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id WNylL5sy7WJ2GgAAIUCqbw (envelope-from ) for ; Fri, 05 Aug 2022 11:09:15 -0400 Received: from proxy9.mail.ord1c.rsapps.net ([172.28.255.1]) by director9.mail.ord1d.rsapps.net with LMTP id CG6CL5sy7WKSWQAAalYnBA (envelope-from ) for ; Fri, 05 Aug 2022 11:09:15 -0400 Received: from smtp21.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy9.mail.ord1c.rsapps.net with LMTPS id iCMHL5sy7WKAJQAAgxtkuw (envelope-from ) for ; Fri, 05 Aug 2022 11:09:15 -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=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 91622798-14d0-11ed-ac8d-a0369f0d8808-1-1 Received: from [216.105.38.7] ([216.105.38.7:48518] helo=lists.sourceforge.net) by smtp21.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 9C/80-27606-A923DE26; Fri, 05 Aug 2022 11:09:14 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1oJyvt-0002Ff-GT; Fri, 05 Aug 2022 15:08:13 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oJyvs-0002FU-Hv for openvpn-devel@lists.sourceforge.net; Fri, 05 Aug 2022 15:08:12 +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=IVuk1XLKgyWJmcdgmzyGf1uwrFo/rnNaX6LM8t1COg8=; b=HVorBtHi9shyHTnXH6939/kDuN /O9rq7hhszh+/Y8byysUORpdOMRVi2nFKn9cTQlYBxvvrGfByPb6sAaRcCH6696ws7RlTD+ppeN91 heWeCiYkVEcx2TAS6t/iJgQBQpk4zS5t9v8ZyHGuCIYbhxFJYY55gH/QKYAsGV4nqoAI=; 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=IVuk1XLKgyWJmcdgmzyGf1uwrFo/rnNaX6LM8t1COg8=; b=A B+1OTvvdrKLIc9dMzm7RPgHWKun9cpmXerEw8vMVBXPnuWA/Y8bTHH6F6sVAFV4DlrivXv2Mx/pUA BvL6iIsNrxwla0F9rfvCNeXvc5rtCjDVmEtv67ix2lVduwqmgzSUtguzWL04VG4FOrL44K+BMc3xY oGH9yw41ucvDlTV8=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1oJyvq-004XFh-Rp for openvpn-devel@lists.sourceforge.net; Fri, 05 Aug 2022 15:08:12 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Fri, 5 Aug 2022 17:08:37 +0200 Message-Id: <20220805150837.8169-1-a@unstable.cc> 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: The do_deferred_options() function is invoked also on the server side in order to process all negotiated bits. However, in this case we should not perform any pull options check, as it's required only on the client side. Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1oJyvq-004XFh-Rp Subject: [Openvpn-devel] [PATCH] dco: perform pull options check only if we pulled any option X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gert Doering , Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox The do_deferred_options() function is invoked also on the server side in order to process all negotiated bits. However, in this case we should not perform any pull options check, as it's required only on the client side. Move check within the "if (options.pull)" block to ensure we perform the check only when required. Reported-By: Gert Doering Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- src/openvpn/init.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 2e7544de..b6705921 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -2402,22 +2402,23 @@ do_deferred_options(struct context *c, const unsigned int found) c->c2.tls_multi->peer_id = c->options.peer_id; } - /* process (potentially pushed) crypto options */ + /* process (potentially) pushed options */ if (c->options.pull) { if (!check_pull_client_ncp(c, found)) { return false; } - } - /* Check if pushed options are compatible with DCO, if enabled */ - if (dco_enabled(&c->options) - && !dco_check_pull_options(D_PUSH_ERRORS, &c->options)) - { - msg(D_PUSH_ERRORS, "OPTIONS ERROR: pushed options are incompatible with " - "data channel offload. Use --disable-dco to connect to this server"); - return false; + /* Check if pushed options are compatible with DCO, if enabled */ + if (dco_enabled(&c->options) + && !dco_check_pull_options(D_PUSH_ERRORS, &c->options)) + { + msg(D_PUSH_ERRORS, "OPTIONS ERROR: pushed options are incompatible " + "with data channel offload. Use --disable-dco to connect to " + "this server"); + return false; + } } return true;