Browse code

Fixed disabling crypto and SSL

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>

Adriaan de Jong authored on 2011/10/24 17:46:01
Showing 12 changed files
... ...
@@ -86,6 +86,8 @@ openvpn_SOURCES = \
86 86
 	common.h \
87 87
 	config-win32.h \
88 88
 	crypto.c crypto.h crypto_backend.h \
89
+	crypto_openssl.c crypto_openssl.h \
90
+	crypto_polarssl.c crypto_polarssl.h \
89 91
 	dhcp.c dhcp.h \
90 92
 	errlevel.h \
91 93
 	error.c error.h \
... ...
@@ -115,6 +117,8 @@ openvpn_SOURCES = \
115 115
         ntlm.c ntlm.h \
116 116
 	occ.c occ.h occ-inline.h \
117 117
 	pkcs11.c pkcs11.h pkcs11_backend.h \
118
+	pkcs11_openssl.c \
119
+	pkcs11_polarssl.c \
118 120
 	openvpn.c openvpn.h \
119 121
 	openvpn-plugin.h \
120 122
 	options.c options.h \
... ...
@@ -139,7 +143,11 @@ openvpn_SOURCES = \
139 139
 	socket.c socket.h \
140 140
 	socks.c socks.h \
141 141
 	ssl.c ssl.h  ssl_backend.h \
142
+	ssl_openssl.c ssl_openssl.h \
143
+	ssl_polarssl.c ssl_polarssl.h \
142 144
 	ssl_verify.c ssl_verify.h ssl_verify_backend.h \
145
+	ssl_verify_openssl.c ssl_verify_openssl.h \
146
+	ssl_verify_polarssl.c ssl_verify_polarssl.h \
143 147
 	status.c status.h \
144 148
 	syshead.h \
145 149
 	tun.c tun.h \
... ...
@@ -153,21 +161,6 @@ configure.h: Makefile
153 153
 	awk -f $(srcdir)/configure_h.awk config.h > $@
154 154
 	awk -f $(srcdir)/configure_log.awk config.log >> $@
155 155
 
156
-if USE_OPENSSL
157
-openvpn_SOURCES += \
158
-	crypto_openssl.c crypto_openssl.h \
159
-	pkcs11_openssl.c \
160
-	ssl_openssl.c ssl_openssl.h \
161
-	ssl_verify_openssl.c ssl_verify_openssl.h
162
-endif
163
-if USE_POLARSSL
164
-openvpn_SOURCES += \
165
-	crypto_polarssl.c crypto_polarssl.h \
166
-	pkcs11_polarssl.c \
167
-	ssl_polarssl.c ssl_polarssl.h \
168
-	ssl_verify_polarssl.c ssl_verify_polarssl.h
169
-endif
170
-
171 156
 dist-hook:
172 157
 	cd $(distdir) && for i in $(EXTRA_DIST) $(SUBDIRS) ; do find $$i -name .svn -type d -prune -exec rm -rf '{}' ';' ; rm -f `find $$i -type f | grep -E '(^|\/)\.?\#|\~$$|\.s?o$$'` ; done
173 158
 
... ...
@@ -299,8 +299,6 @@ AC_ARG_WITH([ssl-type],
299 299
    esac],
300 300
    [SSL_LIB="openssl"]
301 301
 )
302
-AM_CONDITIONAL([USE_OPENSSL], [test x$SSL_LIB = xopenssl])
303
-AM_CONDITIONAL([USE_POLARSSL], [test x$SSL_LIB = xpolarssl])
304 302
 
305 303
 dnl fix search path, to allow compilers to find syshead.h
306 304
 CPPFLAGS="$CPPFLAGS -I${srcdir}"
... ...
@@ -29,6 +29,8 @@
29 29
 
30 30
 #include "syshead.h"
31 31
 
32
+#if defined(USE_CRYPTO) && defined(USE_OPENSSL)
33
+
32 34
 #include "basic.h"
33 35
 #include "buffer.h"
34 36
 #include "integer.h"
... ...
@@ -789,3 +791,5 @@ hmac_ctx_final (HMAC_CTX *ctx, uint8_t *dst)
789 789
 
790 790
   HMAC_Final (ctx, dst, &in_hmac_len);
791 791
 }
792
+
793
+#endif /* USE_CRYPTO && USE_OPENSSL */
... ...
@@ -29,6 +29,8 @@
29 29
 
30 30
 #include "syshead.h"
31 31
 
32
+#if defined(USE_CRYPTO) && defined(USE_POLARSSL)
33
+
32 34
 #include "errlevel.h"
33 35
 #include "basic.h"
34 36
 #include "buffer.h"
... ...
@@ -555,3 +557,5 @@ hmac_ctx_final (md_context_t *ctx, uint8_t *dst)
555 555
 {
556 556
   ASSERT(0 == md_hmac_finish(ctx, dst));
557 557
 }
558
+
559
+#endif /* USE_CRYPTO && USE_POLARSSL */
... ...
@@ -77,7 +77,7 @@ struct options_pre_pull
77 77
 };
78 78
 
79 79
 #endif
80
-#if !defined(USE_OPENSSL) && !defined(USE_POLARSSL)
80
+#if defined(USE_CRYPTO) && !defined(USE_OPENSSL) && !defined(USE_POLARSSL)
81 81
 # error "At least one of OpenSSL or PolarSSL needs to be defined."
82 82
 #endif
83 83
 
... ...
@@ -29,7 +29,7 @@
29 29
 
30 30
 #include "syshead.h"
31 31
 
32
-#ifdef ENABLE_PKCS11
32
+#if defined(ENABLE_PKCS11) && defined(USE_OPENSSL)
33 33
 
34 34
 #include "errlevel.h"
35 35
 #include "pkcs11_backend.h"
... ...
@@ -185,4 +185,4 @@ cleanup:
185 185
     }
186 186
   return ret;
187 187
 }
188
-#endif /* ENABLE_PKCS11 */
188
+#endif /* defined(ENABLE_PKCS11) && defined(ENABLE_OPENSSL) */
... ...
@@ -29,7 +29,7 @@
29 29
 
30 30
 #include "syshead.h"
31 31
 
32
-#if defined(ENABLE_PKCS11)
32
+#if defined(ENABLE_PKCS11) && defined(USE_POLARSSL)
33 33
 
34 34
 #include "errlevel.h"
35 35
 #include "pkcs11_backend.h"
... ...
@@ -118,4 +118,4 @@ cleanup:
118 118
 
119 119
   return ret;
120 120
 }
121
-#endif /* defined(ENABLE_PKCS11) */
121
+#endif /* defined(ENABLE_PKCS11) && defined(USE_POLARSSL) */
... ...
@@ -28,6 +28,9 @@
28 28
  */
29 29
 
30 30
 #include "syshead.h"
31
+
32
+#if defined(USE_SSL) && defined(USE_OPENSSL)
33
+
31 34
 #include "errlevel.h"
32 35
 #include "buffer.h"
33 36
 #include "misc.h"
... ...
@@ -1286,3 +1289,5 @@ get_highest_preference_tls_cipher (char *buf, int size)
1286 1286
   SSL_free (ssl);
1287 1287
   SSL_CTX_free (ctx);
1288 1288
 }
1289
+
1290
+#endif /* defined(USE_SSL) && defined(USE_OPENSSL) */
... ...
@@ -28,6 +28,9 @@
28 28
  */
29 29
 
30 30
 #include "syshead.h"
31
+
32
+#if defined(USE_SSL) && defined(USE_POLARSSL)
33
+
31 34
 #include "errlevel.h"
32 35
 #include "ssl_backend.h"
33 36
 #include "buffer.h"
... ...
@@ -857,3 +860,5 @@ get_highest_preference_tls_cipher (char *buf, int size)
857 857
   cipher_name = ssl_get_ciphersuite_name(*ciphers);
858 858
   strncpynt (buf, cipher_name, size);
859 859
 }
860
+
861
+#endif /* defined(USE_SSL) && defined(USE_POLARSSL) */
... ...
@@ -28,6 +28,9 @@
28 28
  */
29 29
 
30 30
 #include "syshead.h"
31
+
32
+#if defined(USE_CRYPTO) && defined(USE_SSL)
33
+
31 34
 #include "misc.h"
32 35
 #include "manage.h"
33 36
 #include "ssl_verify.h"
... ...
@@ -1237,3 +1240,4 @@ verify_final_auth_checks(struct tls_multi *multi, struct tls_session *session)
1237 1237
       gc_free (&gc);
1238 1238
     }
1239 1239
 }
1240
+#endif /* defined(USE_CRYPTO) && defined(USE_SSL) */
... ...
@@ -27,6 +27,10 @@
27 27
  * @file Control Channel Verification Module OpenSSL implementation
28 28
  */
29 29
 
30
+#include "syshead.h"
31
+
32
+#if defined(USE_SSL) && defined(USE_OPENSSL)
33
+
30 34
 #include "ssl_verify.h"
31 35
 #include "ssl_verify_backend.h"
32 36
 #include "ssl_openssl.h"
... ...
@@ -584,3 +588,5 @@ end:
584 584
 
585 585
   return retval;
586 586
 }
587
+
588
+#endif /* defined(USE_SSL) && defined(USE_OPENSSL) */
... ...
@@ -27,6 +27,10 @@
27 27
  * @file Control Channel Verification Module PolarSSL backend
28 28
  */
29 29
 
30
+#include "syshead.h"
31
+
32
+#if defined(USE_SSL) && defined(USE_POLARSSL)
33
+
30 34
 #include "ssl_verify.h"
31 35
 #include <polarssl/sha1.h>
32 36
 
... ...
@@ -417,3 +421,5 @@ end:
417 417
   x509_crl_free(&crl);
418 418
   return retval;
419 419
 }
420
+
421
+#endif /* #if defined(USE_SSL) && defined(USE_POLARSSL) */