Browse code

Remove option to disable crypto engine

With this patch we remove the possibility to disable the crypto engine
(ENABLE_CRYPTO define) at configuration time.

[--disable-crypto has been removed from .travis.yml too]

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20171203124952.15220-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15979.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Antonio Quartulli authored on 2017/12/03 21:49:52
Showing 7 changed files
... ...
@@ -59,10 +59,7 @@ matrix:
59 59
     - env: SSLLIB="openssl" CHOST=i686-w64-mingw32
60 60
       os: linux
61 61
       compiler: ": Win32 build only"
62
-    - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-crypto" EXTRA_SCRIPT="make distcheck"
63
-      os: linux
64
-      compiler: clang
65
-    - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-lzo"
62
+    - env: SSLLIB="openssl" EXTRA_CONFIG="--disable-lzo" EXTRA_SCRIPT="make distcheck"
66 63
       os: linux
67 64
       compiler: clang
68 65
     - env: SSLLIB="openssl" EXTRA_CONFIG="--enable-small"
... ...
@@ -4,7 +4,6 @@
4 4
 
5 5
 #define ENABLE_DEF_AUTH 1
6 6
 #define ENABLE_PF 1
7
-#define ENABLE_CRYPTO 1
8 7
 #define ENABLE_CRYPTO_OPENSSL 1
9 8
 #define ENABLE_DEBUG 1
10 9
 #define ENABLE_EUREPHIA 1
... ...
@@ -78,13 +78,6 @@ AC_ARG_ENABLE(comp-stub,
78 78
 )
79 79
 
80 80
 AC_ARG_ENABLE(
81
-	[crypto],
82
-	[AS_HELP_STRING([--disable-crypto], [disable crypto support @<:@default=yes@:>@])],
83
-	,
84
-	[enable_crypto="yes"]
85
-)
86
-
87
-AC_ARG_ENABLE(
88 81
 	[ofb-cfb],
89 82
 	[AS_HELP_STRING([--disable-ofb-cfb], [disable support for OFB and CFB cipher modes @<:@default=yes@:>@])],
90 83
 	,
... ...
@@ -843,7 +836,7 @@ PKG_CHECK_MODULES(
843 843
 	[]
844 844
 )
845 845
 
846
-if test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "openssl"; then
846
+if test "${with_crypto_library}" = "openssl"; then
847 847
 	AC_ARG_VAR([OPENSSL_CFLAGS], [C compiler flags for OpenSSL])
848 848
 	AC_ARG_VAR([OPENSSL_LIBS], [linker flags for OpenSSL])
849 849
 
... ...
@@ -958,11 +951,10 @@ if test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "openssl"; then
958 958
 	CFLAGS="${saved_CFLAGS}"
959 959
 	LIBS="${saved_LIBS}"
960 960
 
961
-	have_crypto="yes"
962 961
 	AC_DEFINE([ENABLE_CRYPTO_OPENSSL], [1], [Use OpenSSL library])
963 962
 	CRYPTO_CFLAGS="${OPENSSL_CFLAGS}"
964 963
 	CRYPTO_LIBS="${OPENSSL_LIBS}"
965
-elif test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "mbedtls"; then
964
+elif test "${with_crypto_library}" = "mbedtls"; then
966 965
 	AC_ARG_VAR([MBEDTLS_CFLAGS], [C compiler flags for mbedtls])
967 966
 	AC_ARG_VAR([MBEDTLS_LIBS], [linker flags for mbedtls])
968 967
 
... ...
@@ -1041,11 +1033,10 @@ elif test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "mbedtls"; th
1041 1041
 
1042 1042
 	CFLAGS="${saved_CFLAGS}"
1043 1043
 	LIBS="${saved_LIBS}"
1044
-	have_crypto="yes"
1045 1044
 	AC_DEFINE([ENABLE_CRYPTO_MBEDTLS], [1], [Use mbed TLS library])
1046 1045
 	CRYPTO_CFLAGS="${MBEDTLS_CFLAGS}"
1047 1046
 	CRYPTO_LIBS="${MBEDTLS_LIBS}"
1048
-elif test "${enable_crypto}" = "yes"; then
1047
+else
1049 1048
 	AC_MSG_ERROR([Invalid crypto library: ${with_crypto_library}])
1050 1049
 fi
1051 1050
 
... ...
@@ -1245,14 +1236,10 @@ test "${enable_def_auth}" = "yes" && AC_DEFINE([ENABLE_DEF_AUTH], [1], [Enable d
1245 1245
 test "${enable_pf}" = "yes" && AC_DEFINE([ENABLE_PF], [1], [Enable internal packet filter])
1246 1246
 test "${enable_strict_options}" = "yes" && AC_DEFINE([ENABLE_STRICT_OPTIONS_CHECK], [1], [Enable strict options check between peers])
1247 1247
 
1248
-if test "${enable_crypto}" = "yes"; then
1249
-	test "${have_crypto}" != "yes" && AC_MSG_ERROR([${with_crypto_library} crypto is required but missing])
1250
-	test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes])
1251
-	test "${have_crypto_aead_modes}" = "yes" && AC_DEFINE([HAVE_AEAD_CIPHER_MODES], [1], [Use crypto library])
1252
-	OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CFLAGS}"
1253
-	OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_LIBS}"
1254
-	AC_DEFINE([ENABLE_CRYPTO], [1], [Enable crypto library])
1255
-fi
1248
+test "${enable_crypto_ofb_cfb}" = "yes" && AC_DEFINE([ENABLE_OFB_CFB_MODE], [1], [Enable OFB and CFB cipher modes])
1249
+test "${have_crypto_aead_modes}" = "yes" && AC_DEFINE([HAVE_AEAD_CIPHER_MODES], [1], [Use crypto library])
1250
+OPTIONAL_CRYPTO_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${CRYPTO_CFLAGS}"
1251
+OPTIONAL_CRYPTO_LIBS="${OPTIONAL_CRYPTO_LIBS} ${CRYPTO_LIBS}"
1256 1252
 
1257 1253
 if test "${enable_plugins}" = "yes"; then
1258 1254
 	OPTIONAL_DL_LIBS="${DL_LIBS}"
... ...
@@ -1292,7 +1279,6 @@ fi
1292 1292
 
1293 1293
 if test "${enable_pkcs11}" = "yes"; then
1294 1294
 	test "${have_pkcs11_helper}" != "yes" && AC_MSG_ERROR([PKCS11 enabled but libpkcs11-helper is missing])
1295
-	test "${enable_crypto}" != "yes" && AC_MSG_ERROR([PKCS11 can be enabled only if crypto is enabled])
1296 1295
 	OPTIONAL_PKCS11_HELPER_CFLAGS="${PKCS11_HELPER_CFLAGS}"
1297 1296
 	OPTIONAL_PKCS11_HELPER_LIBS="${PKCS11_HELPER_LIBS}"
1298 1297
 	AC_DEFINE([ENABLE_PKCS11], [1], [Enable PKCS11])
... ...
@@ -1372,7 +1358,6 @@ AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
1372 1372
 AM_CONDITIONAL([GIT_CHECKOUT], [test "${GIT_CHECKOUT}" = "yes"])
1373 1373
 AM_CONDITIONAL([ENABLE_PLUGIN_AUTH_PAM], [test "${enable_plugin_auth_pam}" = "yes"])
1374 1374
 AM_CONDITIONAL([ENABLE_PLUGIN_DOWN_ROOT], [test "${enable_plugin_down_root}" = "yes"])
1375
-AM_CONDITIONAL([ENABLE_CRYPTO], [test "${enable_crypto}" = "yes"])
1376 1375
 AM_CONDITIONAL([HAVE_LD_WRAP_SUPPORT], [test "${have_ld_wrap_support}" = "yes"])
1377 1376
 
1378 1377
 sampledir="\$(docdir)/sample"
... ...
@@ -235,7 +235,7 @@ EXPAND_ONLY_PREDEF     = NO
235 235
 SEARCH_INCLUDES        = YES
236 236
 INCLUDE_PATH           =
237 237
 INCLUDE_FILE_PATTERNS  =
238
-PREDEFINED             = _WIN32 NTLM USE_LZO ENABLE_FRAGMENT P2MP P2MP_SERVER ENABLE_CRYPTO ENABLE_CRYPTO_OPENSSL ENABLE_PLUGIN ENABLE_MANAGEMENT ENABLE_OCC HAVE_GETTIMEOFDAY
238
+PREDEFINED             = _WIN32 NTLM USE_LZO ENABLE_FRAGMENT P2MP P2MP_SERVER ENABLE_CRYPTO_OPENSSL ENABLE_PLUGIN ENABLE_MANAGEMENT ENABLE_OCC HAVE_GETTIMEOFDAY
239 239
 EXPAND_AS_DEFINED      =
240 240
 SKIP_FUNCTION_MACROS   = YES
241 241
 #---------------------------------------------------------------------------
... ...
@@ -27,8 +27,6 @@
27 27
  * See the README file for build instructions.
28 28
  */
29 29
 
30
-#define ENABLE_CRYPTO
31
-
32 30
 #include <stdio.h>
33 31
 #include <string.h>
34 32
 #include <stdlib.h>
... ...
@@ -35,8 +35,6 @@
35 35
 #include <string.h>
36 36
 #include <stdlib.h>
37 37
 
38
-#define ENABLE_CRYPTO
39
-
40 38
 #include "openvpn-plugin.h"
41 39
 
42 40
 /*
... ...
@@ -15,9 +15,7 @@ MAINTAINERCLEANFILES = \
15 15
 SUBDIRS = unit_tests
16 16
 
17 17
 test_scripts = t_client.sh
18
-if ENABLE_CRYPTO
19 18
 test_scripts += t_lpback.sh t_cltsrv.sh
20
-endif
21 19
 
22 20
 TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)"
23 21
 TESTS = $(test_scripts)