References: <20171202134541.7688-1-a@...2181...> <20171202134541.7688-5-a@...2181...> From: Steffan Karger Message-ID: Date: Sun, 3 Dec 2017 15:17:51 +0100 MIME-Version: 1.0 In-Reply-To: <20171202134541.7688-5-a@...2181...> Content-Language: en-US Subject: Re: [Openvpn-devel] [PATCH 5/7] Remove CIPHER_ENABLED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: openvpn-devel@lists.sourceforge.net On 02-12-17 14:45, Antonio Quartulli wrote: > 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 > --- > 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 > Acked-by: Steffan Karger -Steffan