All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <a@...2181...>
To: openvpn-devel@lists.sourceforge.net
Cc: Antonio Quartulli <a@...2181...>
Subject: [Openvpn-devel] [PATCH 5/7] Remove CIPHER_ENABLED
Date: Sat,  2 Dec 2017 21:45:39 +0800	[thread overview]
Message-ID: <20171202134541.7688-5-a@...2181...> (raw)
In-Reply-To: <20171202134541.7688-1-a@...2181...>

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 <a@...2181...>
---
 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
 
-- 
2.15.1



  parent reply	other threads:[~2017-12-02 13:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02 13:45 [Openvpn-devel] [PATCH 1/7] Remove option to disable crypto engine Antonio Quartulli
2017-12-02 13:45 ` [Openvpn-devel] [PATCH 2/7] Remove ENABLE_CRYPTO Antonio Quartulli
2017-12-03 12:49   ` [Openvpn-devel] [PATCH v2 2/7] Remove option to disable crypto engine Antonio Quartulli
2017-12-03 14:14     ` Steffan Karger
2017-12-04 18:42     ` [Openvpn-devel] [PATCH applied] " Gert Doering
2017-12-02 13:45 ` [Openvpn-devel] [PATCH 3/7] Remove ENABLE_PUSH_PEER_INFO Antonio Quartulli
2017-12-03 14:15   ` Steffan Karger
2017-12-04 18:48   ` [Openvpn-devel] [PATCH applied] " Gert Doering
2017-12-02 13:45 ` [Openvpn-devel] [PATCH 4/7] Remove SSL_LIB_VER_STR Antonio Quartulli
2017-12-03 14:17   ` Steffan Karger
2017-12-04 18:48   ` [Openvpn-devel] [PATCH applied] " Gert Doering
2017-12-02 13:45 ` Antonio Quartulli [this message]
2017-12-03 14:17   ` [Openvpn-devel] [PATCH 5/7] Remove CIPHER_ENABLED Steffan Karger
2017-12-04 18:45     ` Gert Doering
2017-12-05  6:45       ` Antonio Quartulli
2017-12-02 13:45 ` [Openvpn-devel] [PATCH 6/7] Remove MD5SUM Antonio Quartulli
2017-12-03 14:18   ` Steffan Karger
2017-12-04 18:48   ` [Openvpn-devel] [PATCH applied] " Gert Doering
2017-12-02 13:45 ` [Openvpn-devel] [PATCH 7/7] Remove TLS_MODE Antonio Quartulli
2017-12-03 14:45   ` Steffan Karger
2017-12-04  6:39     ` Antonio Quartulli
2017-12-03  9:39 ` [Openvpn-devel] [PATCH 1/7] Remove option to disable crypto engine Steffan Karger
2017-12-03 10:05   ` Antonio Quartulli
2017-12-03 12:49 ` [Openvpn-devel] [PATCH v2 1/7] Remove ENABLE_CRYPTO Antonio Quartulli
2017-12-03 14:12   ` Steffan Karger
2017-12-03 16:15     ` Antonio Quartulli
2017-12-04  1:01       ` [Openvpn-devel] [PATCH v3] " Antonio Quartulli
2017-12-04 16:41         ` Steffan Karger
2017-12-04 18:27         ` [Openvpn-devel] [PATCH applied] " Gert Doering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171202134541.7688-5-a@...2181... \
    --to=openvpn-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.