Skip to contentSkip to conversation

stray USE_SSL in crypto_openssl.c

Openvpn-devel Gert Doering 2 participants 3 messages Apr 14, 2013 – Apr 15, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

this is something for Adriaan or Steffan, I think... in crypto_openssl.c, we have two stray uses of #ifdef USE_SSL...

void
crypto_init_lib (void)
{
#ifndef USE_SSL
#ifndef ENABLE_SMALL
ERR_load_crypto_strings ();
#endif
OpenSSL_add_all_algorithms ();
#endif

...
void
crypto_uninit_lib (void)
{
#ifndef USE_SSL
EVP_cleanup ();
#ifndef ENABLE_SMALL
ERR_free_strings ();
#endif
#endif

... should this be ENABLE_SSL? Or not be there at all?

I won't claim to understand the code, but I can say for sure that we do not have a "USE_SSL" conditional anymore :-) - this is now ENABLE_SSL.

Please check and send patch :-)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#1 lore raw

Hi Gert,

Quoted 25 lines · Gert Doering

this is something for Adriaan or Steffan, I think... in crypto_openssl.c, we have two stray uses of #ifdef USE_SSL...

void
crypto_init_lib (void)
{
#ifndef USE_SSL
#ifndef ENABLE_SMALL
ERR_load_crypto_strings ();
#endif
OpenSSL_add_all_algorithms ();
#endif

...
void
crypto_uninit_lib (void)
{
#ifndef USE_SSL
EVP_cleanup ();
#ifndef ENABLE_SMALL
ERR_free_strings ();
#endif
#endif

Quoted 1 line

... should this be ENABLE_SSL? Or not be there at all?

It should indeed be ENABLE_SSL. The #ifndef confused me at first, so I also added some comments to clarify.

Quoted 4 lines

I won't claim to understand the code, but I can say for sure that we do not have a "USE_SSL" conditional anymore :-) - this is now ENABLE_SSL.

Please check and send patch :-)

Yes sir ;) I attached the patch.

-Steffan

From a4d045dd3acd78999371db8d87c320aa0d0669e5 Mon Sep 17 00:00:00 2001
From: Steffan Karger <[email protected]...>
Date: Mon, 15 Apr 2013 10:45:28 +0200
Subject: [PATCH] Fixed usage of stale define USE_SSL to ENABLE_SSL

---
 doc/doxygen/openvpn.doxyfile |    2 +-
 src/openvpn/crypto_openssl.c |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
doc/doxygen/openvpn.doxyfile +1 -1
index 5d87172..cf26c42 100644
@@ -235,7 +235,7 @@ EXPAND_ONLY_PREDEF     = NO
 SEARCH_INCLUDES        = YES
 INCLUDE_PATH           =
 INCLUDE_FILE_PATTERNS  =
-PREDEFINED             = WIN32 NTLM USE_LZO ENABLE_FRAGMENT P2MP P2MP_SERVER USE_CRYPTO USE_SSL ENABLE_PLUGIN ENABLE_MANAGEMENT ENABLE_OCC HAVE_GETTIMEOFDAY
+PREDEFINED             = WIN32 NTLM USE_LZO ENABLE_FRAGMENT P2MP P2MP_SERVER ENABLE_CRYPTO ENABLE_CRYPTO_OPENSSL ENABLE_SSL ENABLE_PLUGIN ENABLE_MANAGEMENT ENABLE_OCC HAVE_GETTIMEOFDAY
 EXPAND_AS_DEFINED      =
 SKIP_FUNCTION_MACROS   = YES
 #---------------------------------------------------------------------------
src/openvpn/crypto_openssl.c +4 -2
index 21d1762..1501bc8 100644
@@ -194,7 +194,8 @@ crypto_init_lib_engine (const char *engine_name)
 void
 crypto_init_lib (void)
 {
-#ifndef USE_SSL
+#ifndef ENABLE_SSL
+  /* If SSL is enabled init is taken care of in ssl_openssl.c */
 #ifndef ENABLE_SMALL
   ERR_load_crypto_strings ();
 #endif
@@ -215,7 +216,8 @@ crypto_init_lib (void)
 void
 crypto_uninit_lib (void)
 {
-#ifndef USE_SSL
+#ifndef ENABLE_SSL
+  /* If SSL is enabled cleanup is taken care of in ssl_openssl.c */
   EVP_cleanup ();
 #ifndef ENABLE_SMALL
   ERR_free_strings ();
Signature · 1 line
1.7.9.5
#2 lore raw

[Openvpn-devel] [PATCH applied] Re: Fixed usage of stale define USE_SSL to ENABLE_SSL

ACK (since this matches what I assumed it should be :-) - thanks for the extra explanation).

Your patch has been applied to the master and release/2.3 branches.

commit 1d561d4eaebe8652768270b6373023177b8d706d (master) commit eb16a92894b3d93c69b6f56a5b852c5089a5304f (master)

Author: Steffan Karger
Date:   Mon Apr 15 10:45:28 2013 +0200
     Fixed usage of stale define USE_SSL to ENABLE_SSL

     Signed-off-by: Steffan Karger <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/7509
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering