From patchwork Fri May 8 01:44:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sommerseth X-Patchwork-Id: 1106 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.27.255.55]) by backend30.mail.ord1d.rsapps.net with LMTP id sPtvKklGtV5ERwAAIUCqbw for ; Fri, 08 May 2020 07:45:13 -0400 Received: from proxy15.mail.iad3a.rsapps.net ([172.27.255.55]) by director7.mail.ord1d.rsapps.net with LMTP id 4ProJ0lGtV6lNwAAovjBpQ ; Fri, 08 May 2020 07:45:13 -0400 Received: from smtp3.gate.iad3a ([172.27.255.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3a.rsapps.net with LMTP id oNz3IUlGtV6vGAAAHi9b9g ; Fri, 08 May 2020 07:45:13 -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: smtp3.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=fail (p=none; dis=none) header.from=openvpn.net X-Suspicious-Flag: YES X-Classification-ID: 605ffd80-9121-11ea-b5ae-525400af4d07-1-1 Received: from [216.105.38.7] ([216.105.38.7:58164] helo=lists.sourceforge.net) by smtp3.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id D2/B1-19635-94645BE5; Fri, 08 May 2020 07:45:13 -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.90_1) (envelope-from ) id 1jX1QW-0000AI-Mv; Fri, 08 May 2020 11:44:24 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jX1QV-00009i-Ei for openvpn-devel@lists.sourceforge.net; Fri, 08 May 2020 11:44:23 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=koJYTmDHjRmmtoU3Vh3Bjsxv4tmGSE6dW91CSAW+ZjM=; b=biMe4UeED48qVNuKadYdKlTAtO N7uHo3iLkq3H9HP7UQyGWP2hlLGFkpQ2jXlnS1OSSqh1Yc/S/49/zE2CuVbk1ZzF7jAlJN91DfjE6 WBoi4V2C9gQ/JxMsT27yHooOmtBXNaxkP2xEaEl7ffNschksYEHM2AtglB/hFhetQs5c=; 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: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=koJYTmDHjRmmtoU3Vh3Bjsxv4tmGSE6dW91CSAW+ZjM=; b=O qiBdfcueDfGJf3QL3R2kqpx+sQv7yce2MG/NCCEqvWJ0tJubxjJrGG30p0uXTQPVKkXE1aIDzGtse NW+Kq0eM5Dh2RT6DbYRt0b6CgiiBJPGOaDO8H3HabqxL5CdvbpGTbv0J28dw9I+04mkKHnOVnGQlc KtDr2k+YOMjYQCTA=; Received: from mx0.basenordic.cloud ([185.212.44.139]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jX1QU-00CRsY-24 for openvpn-devel@lists.sourceforge.net; Fri, 08 May 2020 11:44:23 +0000 Received: from localhost (unknown [IPv6:::1]) by mx0.basenordic.cloud (Postfix) with ESMTP id AB1AD82B8DE for ; Fri, 8 May 2020 11:44:15 +0000 (UTC) Received: from mx0.basenordic.cloud ([IPv6:::1]) by localhost (winterfell.topphemmelig.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id AXr11gir9wWc for ; Fri, 8 May 2020 13:44:14 +0200 (CEST) Received: from zimbra.sommerseth.email (zimbra.sommerseth.email [172.16.33.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx0.basenordic.cloud (Postfix) with ESMTPS id 93A6281A3A7 for ; Fri, 8 May 2020 13:44:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.sommerseth.email (Postfix) with ESMTP id 01219418A775 for ; Fri, 8 May 2020 13:44:14 +0200 (CEST) Received: from zimbra.sommerseth.email ([127.0.0.1]) by localhost (zimbra.sommerseth.email [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 6n6aeH8WBMdc for ; Fri, 8 May 2020 13:44:13 +0200 (CEST) Received: from optimus.homebase.sommerseths.net (unknown [10.35.7.3]) by zimbra.sommerseth.email (Postfix) with ESMTPS id B4DFC418A76D for ; Fri, 8 May 2020 13:44:13 +0200 (CEST) From: David Sommerseth To: openvpn-devel@lists.sourceforge.net Date: Fri, 8 May 2020 13:44:11 +0200 Message-Id: <20200508114411.15762-1-davids@openvpn.net> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1jX1QU-00CRsY-24 Subject: [Openvpn-devel] [PATCH 2/2] options: Restore --tls-crypt-v2 inline file capability 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Commit cb2e9218f2bc73f re-factored the internal file handling, but somehow overlooked the --tls-crypt-v2 option processing. It was no longer possible to load a configuration file with this key file inlined. There where two issues here. First was that the OPT_P_INLINE flag was not set, so the option parser rejected --tls-crypt-v2 as inline capable. Second issue was that the 'streq(p[1], INLINE_FILE_TAG)' check makes no longer sense, as at this point p[1] contains the file contents. Instead use the is_inline flag. Signed-off-by: David Sommerseth Acked-by: Antonio Quartulli --- src/openvpn/options.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index a37106ce..56c9e411 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -8324,22 +8324,16 @@ add_option(struct options *options, } else if (streq(p[0], "tls-crypt-v2") && p[1] && !p[3]) { - VERIFY_PERMISSION(OPT_P_GENERAL|OPT_P_CONNECTION); + VERIFY_PERMISSION(OPT_P_GENERAL|OPT_P_CONNECTION|OPT_P_INLINE); if (permission_mask & OPT_P_GENERAL) { - if (streq(p[1], INLINE_FILE_TAG) && p[2]) - { - options->tls_crypt_v2_file_inline = p[2]; - } options->tls_crypt_v2_file = p[1]; + options->tls_crypt_v2_file_inline = is_inline; } else if (permission_mask & OPT_P_CONNECTION) { - if (streq(p[1], INLINE_FILE_TAG) && p[2]) - { - options->ce.tls_crypt_v2_file_inline = p[2]; - } options->ce.tls_crypt_v2_file = p[1]; + options->ce.tls_crypt_v2_file_inline = is_inline; } } else if (streq(p[0], "tls-crypt-v2-verify") && p[1] && !p[2])