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...@unstable.cc>
---
 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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to