From patchwork Fri May 8 11:14:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1107 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id qF/PIx7MtV5cUQAAIUCqbw for ; Fri, 08 May 2020 17:16:14 -0400 Received: from proxy10.mail.iad3b.rsapps.net ([172.31.255.6]) by director8.mail.ord1d.rsapps.net with LMTP id GFeNIR7MtV6pTwAAfY0hYg ; Fri, 08 May 2020 17:16:14 -0400 Received: from smtp16.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.iad3b.rsapps.net with LMTP id ACNhHB7MtV6ANQAA/F5p9A ; Fri, 08 May 2020 17:16:14 -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: smtp16.gate.iad3b.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: 25449468-9171-11ea-88b1-5254004ed364-1-1 Received: from [216.105.38.7] ([216.105.38.7:57502] helo=lists.sourceforge.net) by smtp16.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 0A/D6-31049-D1CC5BE5; Fri, 08 May 2020 17:16: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 1jXAKo-0002N9-El; Fri, 08 May 2020 21:15:06 +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 1jXAKm-0002Mt-Ug for openvpn-devel@lists.sourceforge.net; Fri, 08 May 2020 21:15:04 +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=NQj1PbHvyPXKCXMrVuqB4+8RpzYnIHV1VqQX+ghnkAo=; b=c+kPAIHTnXWS/29MVUXvVgC9IN YnGWit6OTNL5/O+o0rVzr7rh1r0HEZf6sg3zGVF+yJ87Jt/M8ONXbnZXagUNZVN6nrstHJab+P8Yl eI0CRIhJvC9gpxt3dUYPelVYuaqm72gZopZo3OnphFx68z1evDUdPT+/KYVXgfokZA3o=; 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=NQj1PbHvyPXKCXMrVuqB4+8RpzYnIHV1VqQX+ghnkAo=; b=W MSa0EzfJuK+TdPuX2IQ0yaDQjvX3RIyq895m3GdjYVAZmveGXPU/DPLna6ORBbXsYwLcIQU7C2rGQ E52rxxqLjXCY0DRQl8z+1nr6Ubpo+Edlb3dmRTUVfUXefMouzQEZT+fiR5XVlX/wVdRHq3Dg9j2lR ov3HOycL6jwfZ2Zg=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jXAKl-002mex-Dw for openvpn-devel@lists.sourceforge.net; Fri, 08 May 2020 21:15:04 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Fri, 8 May 2020 23:14:34 +0200 Message-Id: <20200508211434.27545-1-a@unstable.cc> 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_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1jXAKl-002mex-Dw Subject: [Openvpn-devel] [PATCH] options: fix inlining auth-gen-token-secret file 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: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox With commit ("convert *_inline attributes to bool") the logic for signaling when a certain option is inline has been changed. Due to an overlook, the auth-gen-token-secret was not converted, thus making it impossible to be inlined. Fix parsing logic and allow auth-gen-token-secret to be inlined as well. Signed-off-by: Antonio Quartulli Acked-By: David Sommerseth --- src/openvpn/options.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 56c9e411..2d2089e3 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -6981,16 +6981,12 @@ add_option(struct options *options, } } - else if (streq(p[0], "auth-gen-token-secret") && p[1] && (!p[2] - || (p[2] && streq(p[1], INLINE_FILE_TAG)))) + else if (streq(p[0], "auth-gen-token-secret") && p[1] && !p[2]) { - VERIFY_PERMISSION(OPT_P_GENERAL); + VERIFY_PERMISSION(OPT_P_GENERAL|OPT_P_INLINE); options->auth_token_secret_file = p[1]; + options->auth_token_secret_file_inline = is_inline; - if (streq(p[1], INLINE_FILE_TAG) && p[2]) - { - options->auth_token_secret_file_inline = p[2]; - } } else if (streq(p[0], "client-connect") && p[1]) {