Skip to contentSkip to conversation

Fix builds with --disable-crypto

PATCH In review David Sommerseth 2 participants 2 messages Oct 31, 2016 – Nov 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix builds with --disable-crypto

When building with --disable-crypto the P2MP_SERVER is not defined, thus breaking one place where the struct options auth_token_generate was provided with a default value.

Also remove a lot of compiler warnings from ssl_backend.h due to various undefined structs when doing the same build type.

---
 src/openvpn/options.c     | 5 +++--
 src/openvpn/ssl_backend.h | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)
src/openvpn/options.c +3 -2
index f88e94d..be31ed3 100644
@@ -869,10 +869,11 @@ init_options (struct options *o, const bool init_gc)
 #ifdef ENABLE_PKCS11
   o->pkcs11_pin_cache_period = -1;
 #endif			/* ENABLE_PKCS11 */
-  o->auth_token_generate = false;
 
-/* tmp is only used in P2MP server context */
+/* P2MP server context features */
 #if P2MP_SERVER
+  o->auth_token_generate = false;
+
   /* Set default --tmp-dir */
 #ifdef WIN32
   /* On Windows, find temp dir via enviroment variables */
src/openvpn/ssl_backend.h +3 -0
index 542c373..a61f03a 100644
@@ -124,6 +124,8 @@ int tls_version_parse(const char *vstr, const char *extra);
  */
 int tls_version_max(void);
 
+#ifdef ENABLE_CRYPTO
+
 /**
  * Initialise a library-specific TLS context for a server.
  *
@@ -510,4 +512,5 @@ void get_highest_preference_tls_cipher (char *buf, int size);
  */
 const char * get_ssl_library_version(void);
 
+#endif /* ENABLE_CRYPTO */
 #endif /* SSL_BACKEND_H_ */
Signature · 1 line
1.8.3.1
#1 lore raw

ACK, thanks.

Build tested with default options, --disable-crypto, --disable-management, and --disable-server. All compile fine and pass whatever test can still be run (not much for --disable-crypto today).

Your patch has been applied to the master branch.

commit 51d4d1543a64158cc24f176a8d45e51cbda8cd91

Author: David Sommerseth
Date:   Tue Nov 1 00:07:09 2016 +0100
     Fix builds with --disable-crypto

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg12857.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering