From patchwork Mon Feb 14 23:54:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2289 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.27.255.50]) by backend41.mail.ord1d.rsapps.net with LMTP id UM/HHZiGC2KKZAAAqwncew (envelope-from ) for ; Tue, 15 Feb 2022 05:55:20 -0500 Received: from proxy11.mail.iad3a.rsapps.net ([172.27.255.50]) by director14.mail.ord1d.rsapps.net with LMTP id 0GlHKZiGC2JvGAAAeJ7fFg (envelope-from ) for ; Tue, 15 Feb 2022 05:55:20 -0500 Received: from smtp13.gate.iad3a ([172.27.255.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy11.mail.iad3a.rsapps.net with LMTPS id YBZ7IpiGC2IzJAAAxCvdqw (envelope-from ) for ; Tue, 15 Feb 2022 05:55:20 -0500 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: smtp13.gate.iad3a.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: c3dbd8f4-8e4d-11ec-a9f7-5254004b83b1-1-1 Received: from [216.105.38.7] ([216.105.38.7:57508] helo=lists.sourceforge.net) by smtp13.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 45/E9-16634-7968B026; Tue, 15 Feb 2022 05:55:19 -0500 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 1nJvTY-0008Nh-4N; Tue, 15 Feb 2022 10:54:26 +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 1nJvTW-0008NO-Fl for openvpn-devel@lists.sourceforge.net; Tue, 15 Feb 2022 10:54:25 +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=Sr4192NFxtZECMdlzOw3KluMAJtj4sL4sa6gtORfqKk=; b=KSUIu0d4iq+w829pcijBEsSEOo Yku2LVSyOki7zmTCqsg5F56hwMsGUivdjQaWHTiUjLuwwgLylYcVcj5auraWqud7IwvhO9BCYJHtC rCHqJ9G9dYkE/UfCpoxvZEDhMYO/kzK48f5bxgVtDJEC5kkQ6u+BizXexwRC9QzAxSs4=; 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=Sr4192NFxtZECMdlzOw3KluMAJtj4sL4sa6gtORfqKk=; b=Y LGQJCWQSEt0rfIB8BBYovOV1anMNdLENuWVvx3+9zFnss0C+sVCYDaId01ZHGXNomEKyJiewakRLY BoOLbPILgFKZXoBohUztu0n/ta1I3OkHYZ6bjxtm92IBCqTzpuhHiVbbGUGxeW2jKuFzoMPtRVx8K WIc2Jn4rklTPrxPo=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1nJvTP-000568-C4 for openvpn-devel@lists.sourceforge.net; Tue, 15 Feb 2022 10:54:24 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94.2 (FreeBSD)) (envelope-from ) id 1nJvTE-0003WK-1L; Tue, 15 Feb 2022 11:54:08 +0100 Received: (nullmailer pid 3936386 invoked by uid 10006); Tue, 15 Feb 2022 10:54:07 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 15 Feb 2022 11:54:07 +0100 Message-Id: <20220215105407.3936338-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 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: These checks were not correctly updated. The check in auth-token did nothing at all and the check in tls-crypt was the wrong check but that was hidden by the condition being inverted as well. Reported-By: tincntech@protonmail.com --- src/openvpn/auth_token.c | 2 +- src/openvpn/crypto_backend.h | 3 +-- src/openvpn/tls_crypt.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) 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_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1nJvTP-000568-C4 Subject: [Openvpn-devel] [PATCH] Fix checks of SHA256 in tls-crypt and auth-token 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: tincntech@protonmail.com Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox These checks were not correctly updated. The check in auth-token did nothing at all and the check in tls-crypt was the wrong check but that was hidden by the condition being inverted as well. Reported-By: tincntech@protonmail.com --- src/openvpn/auth_token.c | 2 +- src/openvpn/crypto_backend.h | 3 +-- src/openvpn/tls_crypt.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c index ceae68f6..10c9dde6 100644 --- a/src/openvpn/auth_token.c +++ b/src/openvpn/auth_token.c @@ -38,7 +38,7 @@ auth_token_kt(void) kt.cipher = "none"; kt.digest = "SHA256"; - if (!kt.digest) + if (!md_valid(kt.digest)) { msg(M_WARN, "ERROR: --tls-crypt requires HMAC-SHA-256 support."); return (struct key_type) { 0 }; diff --git a/src/openvpn/crypto_backend.h b/src/openvpn/crypto_backend.h index abf1b876..78260057 100644 --- a/src/openvpn/crypto_backend.h +++ b/src/openvpn/crypto_backend.h @@ -520,8 +520,7 @@ static inline bool md_defined(const char* mdname) * * @param digest Name of the digest to verify, e.g. \c MD5). * - * @return A statically allocated structure containing parameters - * for the given message digest. + * @return the availability of the digest of the given name. */ bool md_valid(const char *digest); diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c index 610168b0..aae2a917 100644 --- a/src/openvpn/tls_crypt.c +++ b/src/openvpn/tls_crypt.c @@ -59,7 +59,7 @@ tls_crypt_kt(void) msg(M_WARN, "ERROR: --tls-crypt requires AES-256-CTR support."); return (struct key_type) { 0 }; } - if (cipher_valid(kt.digest)) + if (!md_valid(kt.digest)) { msg(M_WARN, "ERROR: --tls-crypt requires HMAC-SHA-256 support."); return (struct key_type) { 0 };