From patchwork Sat Dec 2 02:45:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 110 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director4.mail.ord1d.rsapps.net ([172.27.255.56]) by backend31.mail.ord1d.rsapps.net (Dovecot) with LMTP id IwLdAASvIlqeDAAAgoeIoA for ; Sat, 02 Dec 2017 08:47:48 -0500 Received: from proxy14.mail.iad3a.rsapps.net ([172.27.255.56]) by director4.mail.ord1d.rsapps.net (Dovecot) with LMTP id XUhWGQOvIlqyRAAAHDmxtw ; Sat, 02 Dec 2017 08:47:48 -0500 Received: from smtp50.gate.iad3a ([172.27.255.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy14.mail.iad3a.rsapps.net (Dovecot) with LMTP id Wx5yIQOvIlpRAgAA1+b4IQ ; Sat, 02 Dec 2017 08:47:47 -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.34.181.88] Authentication-Results: smtp50.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.34.181.88"; 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-Classification-ID: 612d3a14-d767-11e7-9655-525400c2fb51-1-1 Received: from [216.34.181.88] ([216.34.181.88:38160] helo=lists.sourceforge.net) by smtp50.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id B8/A6-16690-30FA22A5; Sat, 02 Dec 2017 08:47:47 -0500 Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1eL884-0002bu-Rv; Sat, 02 Dec 2017 13:46:52 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eL884-0002bi-95 for openvpn-devel@lists.sourceforge.net; Sat, 02 Dec 2017 13:46:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=tKQpPUcA75AlsQrSdYX8EoX0elfBsdWrajymuFKwYgU=; b=jP4cDDeR9aePSfqI5ko3PT78O1 tYjLmorsFLN+KkGXCdr4azy+DRUn59f8BuHWB73mIJ3hWDtDhLtnB/aNhf2Xm9FqTmaN1j57bdwAO T52fCV2mOvNY3tEsqHS9iHl/DDLPmj34qKaOK84jzwANJFTH8j1VSabthUzoxCtyHfzw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To :MIME-Version:Content-Type:Content-Transfer-Encoding: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=tKQpPUcA75AlsQrSdYX8EoX0elfBsdWrajymuFKwYgU=; b=bwl7xgWX3fjDb4IH1wV5kpTanj A84qgrJd48cqXUF+DVrCtFxan/Cl9VvruTeSbnxRW/qgzX+q4Eja8KeoVXbfj7zTw0wP4WwzBzB5Q l7pJ0lL5MIIB1HgQvwmzgIJsn+5RO6ahRl//KuWJkpcuxOVo2bZgvhdNvK43hq4u8mU0=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) id 1eL883-0003CJ-Dt for openvpn-devel@lists.sourceforge.net; Sat, 02 Dec 2017 13:46:52 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Sat, 2 Dec 2017 21:45:39 +0800 Message-Id: <20171202134541.7688-5-a@unstable.cc> In-Reply-To: <20171202134541.7688-1-a@unstable.cc> References: <20171202134541.7688-1-a@unstable.cc> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [5.148.176.60 listed in list.dnswl.org] -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1eL883-0003CJ-Dt Subject: [Openvpn-devel] [PATCH 5/7] Remove CIPHER_ENABLED 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 MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Now that ENABLE_CRYPTO has been removed, CIPHER_ENABLED is basically a useless shortcut which does not really help the readability of the code. Remove it and use its expanded expression instead. Signed-off-by: Antonio Quartulli Acked-by: Steffan Karger --- src/openvpn/init.c | 4 ++-- src/openvpn/openvpn.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index e013e9ca..f8034ec7 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -2379,7 +2379,7 @@ frame_finalize_options(struct context *c, const struct options *o) * Set adjustment factor for buffer alignment when no * cipher is used. */ - if (!CIPHER_ENABLED(c)) + if (!c->c1.ks.key_type.cipher) { frame_align_to_extra_frame(&c->c2.frame); frame_or_align_flags(&c->c2.frame, @@ -2904,7 +2904,7 @@ do_init_frame(struct context *c) * flexible enough for this, since the frame is already established * before it is known which compression options will be pushed. */ - if (comp_unswapped_prefix(&c->options.comp) && CIPHER_ENABLED(c)) + if (comp_unswapped_prefix(&c->options.comp) && c->c1.ks.key_type.cipher) { frame_add_to_align_adjust(&c->c2.frame, COMP_PREFIX_LEN); frame_or_align_flags(&c->c2.frame, diff --git a/src/openvpn/openvpn.h b/src/openvpn/openvpn.h index fb8ff1a4..d843c913 100644 --- a/src/openvpn/openvpn.h +++ b/src/openvpn/openvpn.h @@ -565,8 +565,6 @@ struct context gc) #define MD5SUM(buf, len, gc) md5sum((buf), (len), 0, (gc)) -#define CIPHER_ENABLED(c) (c->c1.ks.key_type.cipher != NULL) - /* this represents "disabled peer-id" */ #define MAX_PEER_ID 0xFFFFFF