The crypto engine cannot be disabled anymore, therefore get
rid of all the related ifdefs in the code.
This change makes the code simpler and reduces our the
number of config combinations we have to test after a new
change is applied.
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20171204010110.22091-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16004.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
... | ... |
@@ -58,13 +58,11 @@ |
58 | 58 |
* - \c openvpn_decrypt() |
59 | 59 |
* |
60 | 60 |
* @par Settings that control this module's activity |
61 |
- * Whether or not the Data Channel Crypto module is active depends on the |
|
62 |
- * compile-time \c ENABLE_CRYPTO preprocessor macro. How it processes packets |
|
63 |
- * received from the \link data_control Data Channel Control module\endlink at |
|
64 |
- * runtime depends on the associated \c crypto_options structure. To perform |
|
65 |
- * cryptographic operations, the \c crypto_options.key_ctx_bi must contain the |
|
66 |
- * correct cipher and HMAC security parameters for the direction the packet is |
|
67 |
- * traveling in. |
|
61 |
+ * How the data channel processes packets received from the \link data_control |
|
62 |
+ * Data Channel Control module\endlink at runtime depends on the associated |
|
63 |
+ * \c crypto_options structure. To perform cryptographic operations, the |
|
64 |
+ * \c crypto_options.key_ctx_bi must contain the correct cipher and HMAC |
|
65 |
+ * security parameters for the direction the packet is traveling in. |
|
68 | 66 |
* |
69 | 67 |
* @par Crypto algorithms |
70 | 68 |
* This module uses the crypto algorithm implementations of the external |
... | ... |
@@ -26,7 +26,6 @@ |
26 | 26 |
|
27 | 27 |
#define OPENVPN_PLUGIN_VERSION 3 |
28 | 28 |
|
29 |
-#ifdef ENABLE_CRYPTO |
|
30 | 29 |
#ifdef ENABLE_CRYPTO_MBEDTLS |
31 | 30 |
#include <mbedtls/x509_crt.h> |
32 | 31 |
#ifndef __OPENVPN_X509_CERT_T_DECLARED |
... | ... |
@@ -40,7 +39,6 @@ typedef mbedtls_x509_crt openvpn_x509_cert_t; |
40 | 40 |
typedef X509 openvpn_x509_cert_t; |
41 | 41 |
#endif |
42 | 42 |
#endif |
43 |
-#endif |
|
44 | 43 |
|
45 | 44 |
#include <stdarg.h> |
46 | 45 |
#include <stddef.h> |
... | ... |
@@ -391,9 +389,9 @@ struct openvpn_plugin_args_open_return |
391 | 391 |
* *per_client_context : the per-client context pointer which was returned by |
392 | 392 |
* openvpn_plugin_client_constructor_v1, if defined. |
393 | 393 |
* |
394 |
- * current_cert_depth : Certificate depth of the certificate being passed over (only if compiled with ENABLE_CRYPTO defined) |
|
394 |
+ * current_cert_depth : Certificate depth of the certificate being passed over |
|
395 | 395 |
* |
396 |
- * *current_cert : X509 Certificate object received from the client (only if compiled with ENABLE_CRYPTO defined) |
|
396 |
+ * *current_cert : X509 Certificate object received from the client |
|
397 | 397 |
* |
398 | 398 |
*/ |
399 | 399 |
struct openvpn_plugin_args_func_in |
... | ... |
@@ -403,13 +401,8 @@ struct openvpn_plugin_args_func_in |
403 | 403 |
const char **const envp; |
404 | 404 |
openvpn_plugin_handle_t handle; |
405 | 405 |
void *per_client_context; |
406 |
-#ifdef ENABLE_CRYPTO |
|
407 | 406 |
int current_cert_depth; |
408 | 407 |
openvpn_x509_cert_t *current_cert; |
409 |
-#else |
|
410 |
- int __current_cert_depth_disabled; /* Unused, for compatibility purposes only */ |
|
411 |
- void *__current_cert_disabled; /* Unused, for compatibility purposes only */ |
|
412 |
-#endif |
|
413 | 408 |
}; |
414 | 409 |
|
415 | 410 |
|
... | ... |
@@ -30,8 +30,6 @@ |
30 | 30 |
|
31 | 31 |
#include "syshead.h" |
32 | 32 |
|
33 |
-#ifdef ENABLE_CRYPTO |
|
34 |
- |
|
35 | 33 |
#include "crypto.h" |
36 | 34 |
#include "error.h" |
37 | 35 |
#include "integer.h" |
... | ... |
@@ -1842,5 +1840,3 @@ translate_cipher_name_to_openvpn(const char *cipher_name) |
1842 | 1842 |
|
1843 | 1843 |
return pair->openvpn_name; |
1844 | 1844 |
} |
1845 |
- |
|
1846 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -122,8 +122,6 @@ |
122 | 122 |
#ifndef CRYPTO_H |
123 | 123 |
#define CRYPTO_H |
124 | 124 |
|
125 |
-#ifdef ENABLE_CRYPTO |
|
126 |
- |
|
127 | 125 |
#include "crypto_backend.h" |
128 | 126 |
#include "basic.h" |
129 | 127 |
#include "buffer.h" |
... | ... |
@@ -513,6 +511,4 @@ key_ctx_bi_defined(const struct key_ctx_bi *key) |
513 | 513 |
return key->encrypt.cipher || key->encrypt.hmac || key->decrypt.cipher || key->decrypt.hmac; |
514 | 514 |
} |
515 | 515 |
|
516 |
- |
|
517 |
-#endif /* ENABLE_CRYPTO */ |
|
518 | 516 |
#endif /* CRYPTO_H */ |
... | ... |
@@ -34,7 +34,7 @@ |
34 | 34 |
|
35 | 35 |
#include "syshead.h" |
36 | 36 |
|
37 |
-#if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_MBEDTLS) |
|
37 |
+#if defined(ENABLE_CRYPTO_MBEDTLS) |
|
38 | 38 |
|
39 | 39 |
#include "errlevel.h" |
40 | 40 |
#include "basic.h" |
... | ... |
@@ -903,4 +903,4 @@ hmac_ctx_final(mbedtls_md_context_t *ctx, uint8_t *dst) |
903 | 903 |
ASSERT(0 == mbedtls_md_hmac_finish(ctx, dst)); |
904 | 904 |
} |
905 | 905 |
|
906 |
-#endif /* ENABLE_CRYPTO && ENABLE_CRYPTO_MBEDTLS */ |
|
906 |
+#endif /* ENABLE_CRYPTO_MBEDTLS */ |
... | ... |
@@ -34,7 +34,7 @@ |
34 | 34 |
|
35 | 35 |
#include "syshead.h" |
36 | 36 |
|
37 |
-#if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) |
|
37 |
+#if defined(ENABLE_CRYPTO_OPENSSL) |
|
38 | 38 |
|
39 | 39 |
#include "basic.h" |
40 | 40 |
#include "buffer.h" |
... | ... |
@@ -969,4 +969,4 @@ hmac_ctx_final(HMAC_CTX *ctx, uint8_t *dst) |
969 | 969 |
HMAC_Final(ctx, dst, &in_hmac_len); |
970 | 970 |
} |
971 | 971 |
|
972 |
-#endif /* ENABLE_CRYPTO && ENABLE_CRYPTO_OPENSSL */ |
|
972 |
+#endif /* ENABLE_CRYPTO_OPENSSL */ |
... | ... |
@@ -34,14 +34,12 @@ |
34 | 34 |
static inline void |
35 | 35 |
check_tls(struct context *c) |
36 | 36 |
{ |
37 |
-#if defined(ENABLE_CRYPTO) |
|
38 | 37 |
void check_tls_dowork(struct context *c); |
39 | 38 |
|
40 | 39 |
if (c->c2.tls_multi) |
41 | 40 |
{ |
42 | 41 |
check_tls_dowork(c); |
43 | 42 |
} |
44 |
-#endif |
|
45 | 43 |
} |
46 | 44 |
|
47 | 45 |
/* |
... | ... |
@@ -51,7 +49,6 @@ check_tls(struct context *c) |
51 | 51 |
static inline void |
52 | 52 |
check_tls_errors(struct context *c) |
53 | 53 |
{ |
54 |
-#if defined(ENABLE_CRYPTO) |
|
55 | 54 |
void check_tls_errors_co(struct context *c); |
56 | 55 |
|
57 | 56 |
void check_tls_errors_nco(struct context *c); |
... | ... |
@@ -73,7 +70,6 @@ check_tls_errors(struct context *c) |
73 | 73 |
} |
74 | 74 |
} |
75 | 75 |
} |
76 |
-#endif /* if defined(ENABLE_CRYPTO) */ |
|
77 | 76 |
} |
78 | 77 |
|
79 | 78 |
/* |
... | ... |
@@ -220,7 +216,6 @@ check_push_request(struct context *c) |
220 | 220 |
|
221 | 221 |
#endif |
222 | 222 |
|
223 |
-#ifdef ENABLE_CRYPTO |
|
224 | 223 |
/* |
225 | 224 |
* Should we persist our anti-replay packet ID state to disk? |
226 | 225 |
*/ |
... | ... |
@@ -233,7 +228,6 @@ check_packet_id_persist_flush(struct context *c) |
233 | 233 |
packet_id_persist_save(&c->c1.pid_persist); |
234 | 234 |
} |
235 | 235 |
} |
236 |
-#endif |
|
237 | 236 |
|
238 | 237 |
/* |
239 | 238 |
* Set our wakeup to 0 seconds, so we will be rescheduled |
... | ... |
@@ -87,7 +87,6 @@ show_wait_status(struct context *c) |
87 | 87 |
* traffic on the control-channel. |
88 | 88 |
* |
89 | 89 |
*/ |
90 |
-#ifdef ENABLE_CRYPTO |
|
91 | 90 |
void |
92 | 91 |
check_tls_dowork(struct context *c) |
93 | 92 |
{ |
... | ... |
@@ -131,7 +130,6 @@ check_tls_errors_nco(struct context *c) |
131 | 131 |
{ |
132 | 132 |
register_signal(c, c->c2.tls_exit_signal, "tls-error"); /* SOFT-SIGUSR1 -- TLS error */ |
133 | 133 |
} |
134 |
-#endif /* ENABLE_CRYPTO */ |
|
135 | 134 |
|
136 | 135 |
#if P2MP |
137 | 136 |
|
... | ... |
@@ -248,7 +246,6 @@ check_connection_established_dowork(struct context *c) |
248 | 248 |
bool |
249 | 249 |
send_control_channel_string(struct context *c, const char *str, int msglevel) |
250 | 250 |
{ |
251 |
-#ifdef ENABLE_CRYPTO |
|
252 | 251 |
if (c->c2.tls_multi) |
253 | 252 |
{ |
254 | 253 |
struct gc_arena gc = gc_new(); |
... | ... |
@@ -274,7 +271,6 @@ send_control_channel_string(struct context *c, const char *str, int msglevel) |
274 | 274 |
gc_free(&gc); |
275 | 275 |
return stat; |
276 | 276 |
} |
277 |
-#endif /* ENABLE_CRYPTO */ |
|
278 | 277 |
return true; |
279 | 278 |
} |
280 | 279 |
|
... | ... |
@@ -485,7 +481,6 @@ encrypt_sign(struct context *c, bool comp_frag) |
485 | 485 |
#endif |
486 | 486 |
} |
487 | 487 |
|
488 |
-#ifdef ENABLE_CRYPTO |
|
489 | 488 |
/* initialize work buffer with FRAME_HEADROOM bytes of prepend capacity */ |
490 | 489 |
ASSERT(buf_init(&b->encrypt_buf, FRAME_HEADROOM(&c->c2.frame))); |
491 | 490 |
|
... | ... |
@@ -518,7 +513,6 @@ encrypt_sign(struct context *c, bool comp_frag) |
518 | 518 |
} |
519 | 519 |
tls_post_encrypt(c->c2.tls_multi, &c->c2.buf); |
520 | 520 |
} |
521 |
-#endif /* ifdef ENABLE_CRYPTO */ |
|
522 | 521 |
|
523 | 522 |
/* |
524 | 523 |
* Get the address we will be sending the packet to. |
... | ... |
@@ -536,11 +530,9 @@ encrypt_sign(struct context *c, bool comp_frag) |
536 | 536 |
static void |
537 | 537 |
process_coarse_timers(struct context *c) |
538 | 538 |
{ |
539 |
-#ifdef ENABLE_CRYPTO |
|
540 | 539 |
/* flush current packet-id to file once per 60 |
541 | 540 |
* seconds if --replay-persist was specified */ |
542 | 541 |
check_packet_id_persist_flush(c); |
543 |
-#endif |
|
544 | 542 |
|
545 | 543 |
/* should we update status file? */ |
546 | 544 |
check_status_file(c); |
... | ... |
@@ -852,7 +844,6 @@ process_incoming_link_part1(struct context *c, struct link_socket_info *lsi, boo |
852 | 852 |
link_socket_bad_incoming_addr(&c->c2.buf, lsi, &c->c2.from); |
853 | 853 |
} |
854 | 854 |
|
855 |
-#ifdef ENABLE_CRYPTO |
|
856 | 855 |
if (c->c2.tls_multi) |
857 | 856 |
{ |
858 | 857 |
/* |
... | ... |
@@ -909,9 +900,6 @@ process_incoming_link_part1(struct context *c, struct link_socket_info *lsi, boo |
909 | 909 |
register_signal(c, SIGUSR1, "decryption-error"); /* SOFT-SIGUSR1 -- decryption error in TCP mode */ |
910 | 910 |
msg(D_STREAM_ERRORS, "Fatal decryption error (process_incoming_link), restarting"); |
911 | 911 |
} |
912 |
-#else /* ENABLE_CRYPTO */ |
|
913 |
- decrypt_status = true; |
|
914 |
-#endif /* ENABLE_CRYPTO */ |
|
915 | 912 |
} |
916 | 913 |
else |
917 | 914 |
{ |
... | ... |
@@ -1426,8 +1414,6 @@ process_outgoing_link(struct context *c) |
1426 | 1426 |
register_activity(c, size); |
1427 | 1427 |
} |
1428 | 1428 |
|
1429 |
- |
|
1430 |
-#ifdef ENABLE_CRYPTO |
|
1431 | 1429 |
/* for unreachable network and "connecting" state switch to the next host */ |
1432 | 1430 |
if (size < 0 && ENETUNREACH == error_code && c->c2.tls_multi |
1433 | 1431 |
&& !tls_initial_packet_received(c->c2.tls_multi) && c->options.mode == MODE_POINT_TO_POINT) |
... | ... |
@@ -1435,7 +1421,6 @@ process_outgoing_link(struct context *c) |
1435 | 1435 |
msg(M_INFO, "Network unreachable, restarting"); |
1436 | 1436 |
register_signal(c, SIGUSR1, "network-unreachable"); |
1437 | 1437 |
} |
1438 |
-#endif |
|
1439 | 1438 |
} |
1440 | 1439 |
else |
1441 | 1440 |
{ |
... | ... |
@@ -529,13 +529,11 @@ next_connection_entry(struct context *c) |
529 | 529 |
void |
530 | 530 |
init_query_passwords(const struct context *c) |
531 | 531 |
{ |
532 |
-#ifdef ENABLE_CRYPTO |
|
533 | 532 |
/* Certificate password input */ |
534 | 533 |
if (c->options.key_pass_file) |
535 | 534 |
{ |
536 | 535 |
pem_password_setup(c->options.key_pass_file); |
537 | 536 |
} |
538 |
-#endif |
|
539 | 537 |
|
540 | 538 |
#if P2MP |
541 | 539 |
/* Auth user/pass input */ |
... | ... |
@@ -704,7 +702,7 @@ init_static(void) |
704 | 704 |
{ |
705 | 705 |
/* configure_path (); */ |
706 | 706 |
|
707 |
-#if defined(ENABLE_CRYPTO) && defined(DMALLOC) |
|
707 |
+#if defined(DMALLOC) |
|
708 | 708 |
crypto_init_dmalloc(); |
709 | 709 |
#endif |
710 | 710 |
|
... | ... |
@@ -741,14 +739,12 @@ init_static(void) |
741 | 741 |
|
742 | 742 |
update_time(); |
743 | 743 |
|
744 |
-#ifdef ENABLE_CRYPTO |
|
745 | 744 |
init_ssl_lib(); |
746 | 745 |
|
747 | 746 |
/* init PRNG used for IV generation */ |
748 | 747 |
/* When forking, copy this to more places in the code to avoid fork |
749 | 748 |
* random-state predictability */ |
750 | 749 |
prng_init(NULL, 0); |
751 |
-#endif |
|
752 | 750 |
|
753 | 751 |
#ifdef PID_TEST |
754 | 752 |
packet_id_interactive_test(); /* test the sequence number code */ |
... | ... |
@@ -942,9 +938,7 @@ init_static(void) |
942 | 942 |
void |
943 | 943 |
uninit_static(void) |
944 | 944 |
{ |
945 |
-#ifdef ENABLE_CRYPTO |
|
946 | 945 |
free_ssl_lib(); |
947 |
-#endif |
|
948 | 946 |
|
949 | 947 |
#ifdef ENABLE_PKCS11 |
950 | 948 |
pkcs11_terminate(); |
... | ... |
@@ -954,7 +948,7 @@ uninit_static(void) |
954 | 954 |
close_port_share(); |
955 | 955 |
#endif |
956 | 956 |
|
957 |
-#if defined(MEASURE_TLS_HANDSHAKE_STATS) && defined(ENABLE_CRYPTO) |
|
957 |
+#if defined(MEASURE_TLS_HANDSHAKE_STATS) |
|
958 | 958 |
show_tls_performance_stats(); |
959 | 959 |
#endif |
960 | 960 |
} |
... | ... |
@@ -998,7 +992,6 @@ print_openssl_info(const struct options *options) |
998 | 998 |
/* |
999 | 999 |
* OpenSSL info print mode? |
1000 | 1000 |
*/ |
1001 |
-#ifdef ENABLE_CRYPTO |
|
1002 | 1001 |
if (options->show_ciphers || options->show_digests || options->show_engines |
1003 | 1002 |
|| options->show_tls_ciphers || options->show_curves) |
1004 | 1003 |
{ |
... | ... |
@@ -1025,7 +1018,6 @@ print_openssl_info(const struct options *options) |
1025 | 1025 |
} |
1026 | 1026 |
return true; |
1027 | 1027 |
} |
1028 |
-#endif /* ifdef ENABLE_CRYPTO */ |
|
1029 | 1028 |
return false; |
1030 | 1029 |
} |
1031 | 1030 |
|
... | ... |
@@ -1035,7 +1027,6 @@ print_openssl_info(const struct options *options) |
1035 | 1035 |
bool |
1036 | 1036 |
do_genkey(const struct options *options) |
1037 | 1037 |
{ |
1038 |
-#ifdef ENABLE_CRYPTO |
|
1039 | 1038 |
if (options->genkey) |
1040 | 1039 |
{ |
1041 | 1040 |
int nbits_written; |
... | ... |
@@ -1055,7 +1046,6 @@ do_genkey(const struct options *options) |
1055 | 1055 |
options->shared_secret_file); |
1056 | 1056 |
return true; |
1057 | 1057 |
} |
1058 |
-#endif |
|
1059 | 1058 |
return false; |
1060 | 1059 |
} |
1061 | 1060 |
|
... | ... |
@@ -1071,10 +1061,8 @@ do_persist_tuntap(const struct options *options) |
1071 | 1071 |
notnull(options->dev, "TUN/TAP device (--dev)"); |
1072 | 1072 |
if (options->ce.remote || options->ifconfig_local |
1073 | 1073 |
|| options->ifconfig_remote_netmask |
1074 |
-#ifdef ENABLE_CRYPTO |
|
1075 | 1074 |
|| options->shared_secret_file |
1076 | 1075 |
|| options->tls_server || options->tls_client |
1077 |
-#endif |
|
1078 | 1076 |
) |
1079 | 1077 |
{ |
1080 | 1078 |
msg(M_FATAL|M_OPTERR, |
... | ... |
@@ -1226,12 +1214,10 @@ const char * |
1226 | 1226 |
format_common_name(struct context *c, struct gc_arena *gc) |
1227 | 1227 |
{ |
1228 | 1228 |
struct buffer out = alloc_buf_gc(256, gc); |
1229 |
-#ifdef ENABLE_CRYPTO |
|
1230 | 1229 |
if (c->c2.tls_multi) |
1231 | 1230 |
{ |
1232 | 1231 |
buf_printf(&out, "[%s] ", tls_common_name(c->c2.tls_multi, false)); |
1233 | 1232 |
} |
1234 |
-#endif |
|
1235 | 1233 |
return BSTR(&out); |
1236 | 1234 |
} |
1237 | 1235 |
|
... | ... |
@@ -1333,7 +1319,6 @@ do_init_timers(struct context *c, bool deferred) |
1333 | 1333 |
#endif |
1334 | 1334 |
|
1335 | 1335 |
/* initialize packet_id persistence timer */ |
1336 |
-#ifdef ENABLE_CRYPTO |
|
1337 | 1336 |
if (c->options.packet_id_file) |
1338 | 1337 |
{ |
1339 | 1338 |
event_timeout_init(&c->c2.packet_id_persist_interval, 60, now); |
... | ... |
@@ -1342,7 +1327,6 @@ do_init_timers(struct context *c, bool deferred) |
1342 | 1342 |
/* initialize tmp_int optimization that limits the number of times we call |
1343 | 1343 |
* tls_multi_process in the main event loop */ |
1344 | 1344 |
interval_init(&c->c2.tmp_int, TLS_MULTI_HORIZON, TLS_MULTI_REFRESH); |
1345 |
-#endif |
|
1346 | 1345 |
} |
1347 | 1346 |
} |
1348 | 1347 |
|
... | ... |
@@ -1485,7 +1469,6 @@ initialization_sequence_completed(struct context *c, const unsigned int flags) |
1485 | 1485 |
do_uid_gid_chroot(c, true); |
1486 | 1486 |
|
1487 | 1487 |
|
1488 |
-#ifdef ENABLE_CRYPTO |
|
1489 | 1488 |
/* |
1490 | 1489 |
* In some cases (i.e. when receiving auth-token via |
1491 | 1490 |
* push-reply) the auth-nocache option configured on the |
... | ... |
@@ -1497,7 +1480,6 @@ initialization_sequence_completed(struct context *c, const unsigned int flags) |
1497 | 1497 |
{ |
1498 | 1498 |
delayed_auth_pass_purge(); |
1499 | 1499 |
} |
1500 |
-#endif /* ENABLE_CRYPTO */ |
|
1501 | 1500 |
|
1502 | 1501 |
/* Test if errors */ |
1503 | 1502 |
if (flags & ISC_ERRORS) |
... | ... |
@@ -2136,12 +2118,10 @@ pull_permission_mask(const struct context *c) |
2136 | 2136 |
flags |= (OPT_P_ROUTE | OPT_P_IPWIN32); |
2137 | 2137 |
} |
2138 | 2138 |
|
2139 |
-#ifdef ENABLE_CRYPTO |
|
2140 | 2139 |
if (c->options.ncp_enabled) |
2141 | 2140 |
{ |
2142 | 2141 |
flags |= OPT_P_NCP; |
2143 | 2142 |
} |
2144 |
-#endif |
|
2145 | 2143 |
|
2146 | 2144 |
return flags; |
2147 | 2145 |
} |
... | ... |
@@ -2230,7 +2210,6 @@ do_deferred_options(struct context *c, const unsigned int found) |
2230 | 2230 |
msg(D_PUSH, "OPTIONS IMPORT: environment modified"); |
2231 | 2231 |
} |
2232 | 2232 |
|
2233 |
-#ifdef ENABLE_CRYPTO |
|
2234 | 2233 |
if (found & OPT_P_PEER_ID) |
2235 | 2234 |
{ |
2236 | 2235 |
msg(D_PUSH, "OPTIONS IMPORT: peer-id set"); |
... | ... |
@@ -2271,7 +2250,7 @@ do_deferred_options(struct context *c, const unsigned int found) |
2271 | 2271 |
return false; |
2272 | 2272 |
} |
2273 | 2273 |
} |
2274 |
-#endif /* ifdef ENABLE_CRYPTO */ |
|
2274 |
+ |
|
2275 | 2275 |
return true; |
2276 | 2276 |
} |
2277 | 2277 |
|
... | ... |
@@ -2423,19 +2402,15 @@ frame_finalize_options(struct context *c, const struct options *o) |
2423 | 2423 |
static void |
2424 | 2424 |
key_schedule_free(struct key_schedule *ks, bool free_ssl_ctx) |
2425 | 2425 |
{ |
2426 |
-#ifdef ENABLE_CRYPTO |
|
2427 | 2426 |
free_key_ctx_bi(&ks->static_key); |
2428 | 2427 |
if (tls_ctx_initialised(&ks->ssl_ctx) && free_ssl_ctx) |
2429 | 2428 |
{ |
2430 | 2429 |
tls_ctx_free(&ks->ssl_ctx); |
2431 | 2430 |
free_key_ctx_bi(&ks->tls_wrap_key); |
2432 | 2431 |
} |
2433 |
-#endif /* ENABLE_CRYPTO */ |
|
2434 | 2432 |
CLEAR(*ks); |
2435 | 2433 |
} |
2436 | 2434 |
|
2437 |
-#ifdef ENABLE_CRYPTO |
|
2438 |
- |
|
2439 | 2435 |
static void |
2440 | 2436 |
init_crypto_pre(struct context *c, const unsigned int flags) |
2441 | 2437 |
{ |
... | ... |
@@ -2880,12 +2855,10 @@ do_init_crypto_none(const struct context *c) |
2880 | 2880 |
"protected against man-in-the-middle changes. " |
2881 | 2881 |
"PLEASE DO RECONSIDER THIS CONFIGURATION!"); |
2882 | 2882 |
} |
2883 |
-#endif /* ifdef ENABLE_CRYPTO */ |
|
2884 | 2883 |
|
2885 | 2884 |
static void |
2886 | 2885 |
do_init_crypto(struct context *c, const unsigned int flags) |
2887 | 2886 |
{ |
2888 |
-#ifdef ENABLE_CRYPTO |
|
2889 | 2887 |
if (c->options.shared_secret_file) |
2890 | 2888 |
{ |
2891 | 2889 |
do_init_crypto_static(c, flags); |
... | ... |
@@ -2898,11 +2871,6 @@ do_init_crypto(struct context *c, const unsigned int flags) |
2898 | 2898 |
{ |
2899 | 2899 |
do_init_crypto_none(c); |
2900 | 2900 |
} |
2901 |
-#else /* ENABLE_CRYPTO */ |
|
2902 |
- msg(M_WARN, |
|
2903 |
- "******* WARNING *******: " PACKAGE_NAME |
|
2904 |
- " built without crypto library -- encryption and authentication features disabled -- all data will be tunnelled as cleartext"); |
|
2905 |
-#endif /* ENABLE_CRYPTO */ |
|
2906 | 2901 |
} |
2907 | 2902 |
|
2908 | 2903 |
static void |
... | ... |
@@ -3101,7 +3069,6 @@ do_option_warnings(struct context *c) |
3101 | 3101 |
#endif /* if P2MP_SERVER */ |
3102 | 3102 |
#endif /* if P2MP */ |
3103 | 3103 |
|
3104 |
-#ifdef ENABLE_CRYPTO |
|
3105 | 3104 |
if (!o->replay) |
3106 | 3105 |
{ |
3107 | 3106 |
msg(M_WARN, "WARNING: You have disabled Replay Protection (--no-replay) which may make " PACKAGE_NAME " less secure"); |
... | ... |
@@ -3123,7 +3090,6 @@ do_option_warnings(struct context *c) |
3123 | 3123 |
{ |
3124 | 3124 |
msg(M_WARN, "WARNING: --ns-cert-type is DEPRECATED. Use --remote-cert-tls instead."); |
3125 | 3125 |
} |
3126 |
-#endif /* ifdef ENABLE_CRYPTO */ |
|
3127 | 3126 |
|
3128 | 3127 |
/* If a script is used, print appropiate warnings */ |
3129 | 3128 |
if (o->user_script_used) |
... | ... |
@@ -3146,9 +3112,7 @@ do_option_warnings(struct context *c) |
3146 | 3146 |
static void |
3147 | 3147 |
do_init_frame_tls(struct context *c) |
3148 | 3148 |
{ |
3149 |
-#ifdef ENABLE_CRYPTO |
|
3150 | 3149 |
do_init_finalize_tls_frame(c); |
3151 |
-#endif |
|
3152 | 3150 |
} |
3153 | 3151 |
|
3154 | 3152 |
struct context_buffers * |
... | ... |
@@ -3163,10 +3127,8 @@ init_context_buffers(const struct frame *frame) |
3163 | 3163 |
|
3164 | 3164 |
b->aux_buf = alloc_buf(BUF_SIZE(frame)); |
3165 | 3165 |
|
3166 |
-#ifdef ENABLE_CRYPTO |
|
3167 | 3166 |
b->encrypt_buf = alloc_buf(BUF_SIZE(frame)); |
3168 | 3167 |
b->decrypt_buf = alloc_buf(BUF_SIZE(frame)); |
3169 |
-#endif |
|
3170 | 3168 |
|
3171 | 3169 |
#ifdef USE_COMP |
3172 | 3170 |
b->compress_buf = alloc_buf(BUF_SIZE(frame)); |
... | ... |
@@ -3190,10 +3152,8 @@ free_context_buffers(struct context_buffers *b) |
3190 | 3190 |
free_buf(&b->decompress_buf); |
3191 | 3191 |
#endif |
3192 | 3192 |
|
3193 |
-#ifdef ENABLE_CRYPTO |
|
3194 | 3193 |
free_buf(&b->encrypt_buf); |
3195 | 3194 |
free_buf(&b->decrypt_buf); |
3196 |
-#endif |
|
3197 | 3195 |
|
3198 | 3196 |
free(b); |
3199 | 3197 |
} |
... | ... |
@@ -3329,14 +3289,12 @@ do_compute_occ_strings(struct context *c) |
3329 | 3329 |
options_string_version(c->c2.options_string_remote, &gc), |
3330 | 3330 |
c->c2.options_string_remote); |
3331 | 3331 |
|
3332 |
-#ifdef ENABLE_CRYPTO |
|
3333 | 3332 |
if (c->c2.tls_multi) |
3334 | 3333 |
{ |
3335 | 3334 |
tls_multi_init_set_options(c->c2.tls_multi, |
3336 | 3335 |
c->c2.options_string_local, |
3337 | 3336 |
c->c2.options_string_remote); |
3338 | 3337 |
} |
3339 |
-#endif |
|
3340 | 3338 |
|
3341 | 3339 |
gc_free(&gc); |
3342 | 3340 |
} |
... | ... |
@@ -3410,7 +3368,6 @@ do_close_free_buf(struct context *c) |
3410 | 3410 |
static void |
3411 | 3411 |
do_close_tls(struct context *c) |
3412 | 3412 |
{ |
3413 |
-#ifdef ENABLE_CRYPTO |
|
3414 | 3413 |
if (c->c2.tls_multi) |
3415 | 3414 |
{ |
3416 | 3415 |
tls_multi_free(c->c2.tls_multi, true); |
... | ... |
@@ -3429,7 +3386,6 @@ do_close_tls(struct context *c) |
3429 | 3429 |
} |
3430 | 3430 |
c->c2.options_string_local = c->c2.options_string_remote = NULL; |
3431 | 3431 |
#endif |
3432 |
-#endif |
|
3433 | 3432 |
} |
3434 | 3433 |
|
3435 | 3434 |
/* |
... | ... |
@@ -3494,14 +3450,12 @@ do_close_link_socket(struct context *c) |
3494 | 3494 |
static void |
3495 | 3495 |
do_close_packet_id(struct context *c) |
3496 | 3496 |
{ |
3497 |
-#ifdef ENABLE_CRYPTO |
|
3498 | 3497 |
packet_id_free(&c->c2.crypto_options.packet_id); |
3499 | 3498 |
packet_id_persist_save(&c->c1.pid_persist); |
3500 | 3499 |
if (!(c->sig->signal_received == SIGUSR1)) |
3501 | 3500 |
{ |
3502 | 3501 |
packet_id_persist_close(&c->c1.pid_persist); |
3503 | 3502 |
} |
3504 |
-#endif |
|
3505 | 3503 |
} |
3506 | 3504 |
|
3507 | 3505 |
#ifdef ENABLE_FRAGMENT |
... | ... |
@@ -3680,7 +3634,6 @@ do_setup_fast_io(struct context *c) |
3680 | 3680 |
static void |
3681 | 3681 |
do_signal_on_tls_errors(struct context *c) |
3682 | 3682 |
{ |
3683 |
-#ifdef ENABLE_CRYPTO |
|
3684 | 3683 |
if (c->options.tls_exit) |
3685 | 3684 |
{ |
3686 | 3685 |
c->c2.tls_exit_signal = SIGTERM; |
... | ... |
@@ -3689,7 +3642,6 @@ do_signal_on_tls_errors(struct context *c) |
3689 | 3689 |
{ |
3690 | 3690 |
c->c2.tls_exit_signal = SIGUSR1; |
3691 | 3691 |
} |
3692 |
-#endif |
|
3693 | 3692 |
} |
3694 | 3693 |
|
3695 | 3694 |
#ifdef ENABLE_PLUGIN |
... | ... |
@@ -4369,7 +4321,6 @@ inherit_context_child(struct context *dest, |
4369 | 4369 |
/* c1 init */ |
4370 | 4370 |
packet_id_persist_init(&dest->c1.pid_persist); |
4371 | 4371 |
|
4372 |
-#ifdef ENABLE_CRYPTO |
|
4373 | 4372 |
dest->c1.ks.key_type = src->c1.ks.key_type; |
4374 | 4373 |
/* inherit SSL context */ |
4375 | 4374 |
dest->c1.ks.ssl_ctx = src->c1.ks.ssl_ctx; |
... | ... |
@@ -4379,7 +4330,6 @@ inherit_context_child(struct context *dest, |
4379 | 4379 |
dest->c1.ciphername = src->c1.ciphername; |
4380 | 4380 |
dest->c1.authname = src->c1.authname; |
4381 | 4381 |
dest->c1.keysize = src->c1.keysize; |
4382 |
-#endif |
|
4383 | 4382 |
|
4384 | 4383 |
/* options */ |
4385 | 4384 |
dest->options = src->options; |
... | ... |
@@ -4453,9 +4403,7 @@ inherit_context_top(struct context *dest, |
4453 | 4453 |
/* detach plugins */ |
4454 | 4454 |
dest->plugins_owned = false; |
4455 | 4455 |
|
4456 |
-#ifdef ENABLE_CRYPTO |
|
4457 | 4456 |
dest->c2.tls_multi = NULL; |
4458 |
-#endif |
|
4459 | 4457 |
|
4460 | 4458 |
/* detach c1 ownership */ |
4461 | 4459 |
dest->c1.tuntap_owned = false; |
... | ... |
@@ -4513,8 +4461,6 @@ close_context(struct context *c, int sig, unsigned int flags) |
4513 | 4513 |
} |
4514 | 4514 |
} |
4515 | 4515 |
|
4516 |
-#ifdef ENABLE_CRYPTO |
|
4517 |
- |
|
4518 | 4516 |
/* |
4519 | 4517 |
* Do a loopback test |
4520 | 4518 |
* on the crypto subsystem. |
... | ... |
@@ -4542,12 +4488,9 @@ test_crypto_thread(void *arg) |
4542 | 4542 |
return NULL; |
4543 | 4543 |
} |
4544 | 4544 |
|
4545 |
-#endif /* ENABLE_CRYPTO */ |
|
4546 |
- |
|
4547 | 4545 |
bool |
4548 | 4546 |
do_test_crypto(const struct options *o) |
4549 | 4547 |
{ |
4550 |
-#ifdef ENABLE_CRYPTO |
|
4551 | 4548 |
if (o->test_crypto) |
4552 | 4549 |
{ |
4553 | 4550 |
struct context c; |
... | ... |
@@ -4562,6 +4505,5 @@ do_test_crypto(const struct options *o) |
4562 | 4562 |
test_crypto_thread((void *) &c); |
4563 | 4563 |
return true; |
4564 | 4564 |
} |
4565 |
-#endif |
|
4566 | 4565 |
return false; |
4567 | 4566 |
} |
... | ... |
@@ -762,10 +762,8 @@ man_query_need_str(struct management *man, const char *type, const char *action) |
762 | 762 |
static void |
763 | 763 |
man_forget_passwords(struct management *man) |
764 | 764 |
{ |
765 |
-#ifdef ENABLE_CRYPTO |
|
766 | 765 |
ssl_purge_auth(false); |
767 | 766 |
msg(M_CLIENT, "SUCCESS: Passwords were forgotten"); |
768 |
-#endif |
|
769 | 767 |
} |
770 | 768 |
|
771 | 769 |
static void |
... | ... |
@@ -1918,12 +1916,11 @@ man_reset_client_socket(struct management *man, const bool exiting) |
1918 | 1918 |
} |
1919 | 1919 |
if (!exiting) |
1920 | 1920 |
{ |
1921 |
-#ifdef ENABLE_CRYPTO |
|
1922 | 1921 |
if (man->settings.flags & MF_FORGET_DISCONNECT) |
1923 | 1922 |
{ |
1924 | 1923 |
ssl_purge_auth(false); |
1925 | 1924 |
} |
1926 |
-#endif |
|
1925 |
+ |
|
1927 | 1926 |
if (man->settings.flags & MF_SIGNAL) |
1928 | 1927 |
{ |
1929 | 1928 |
int mysig = man_mod_signal(man, SIGUSR1); |
... | ... |
@@ -770,8 +770,6 @@ create_temp_file(const char *directory, const char *prefix, struct gc_arena *gc) |
770 | 770 |
return NULL; |
771 | 771 |
} |
772 | 772 |
|
773 |
-#ifdef ENABLE_CRYPTO |
|
774 |
- |
|
775 | 773 |
/* |
776 | 774 |
* Prepend a random string to hostname to prevent DNS caching. |
777 | 775 |
* For example, foo.bar.gov would be modified to <random-chars>.foo.bar.gov. |
... | ... |
@@ -793,17 +791,6 @@ hostname_randomize(const char *hostname, struct gc_arena *gc) |
793 | 793 |
#undef n_rnd_bytes |
794 | 794 |
} |
795 | 795 |
|
796 |
-#else /* ifdef ENABLE_CRYPTO */ |
|
797 |
- |
|
798 |
-const char * |
|
799 |
-hostname_randomize(const char *hostname, struct gc_arena *gc) |
|
800 |
-{ |
|
801 |
- msg(M_WARN, "WARNING: hostname randomization disabled when crypto support is not compiled"); |
|
802 |
- return hostname; |
|
803 |
-} |
|
804 |
- |
|
805 |
-#endif /* ifdef ENABLE_CRYPTO */ |
|
806 |
- |
|
807 | 796 |
/* |
808 | 797 |
* Put a directory and filename together. |
809 | 798 |
*/ |
... | ... |
@@ -143,13 +143,8 @@ const char **make_arg_array(const char *first, const char *parms, struct gc_aren |
143 | 143 |
const char **make_extended_arg_array(char **p, struct gc_arena *gc); |
144 | 144 |
|
145 | 145 |
/* an analogue to the random() function, but use OpenSSL functions if available */ |
146 |
-#ifdef ENABLE_CRYPTO |
|
147 | 146 |
long int get_random(void); |
148 | 147 |
|
149 |
-#else |
|
150 |
-#define get_random random |
|
151 |
-#endif |
|
152 |
- |
|
153 | 148 |
/* return true if filename can be opened for read */ |
154 | 149 |
bool test_file(const char *filename); |
155 | 150 |
|
... | ... |
@@ -162,7 +157,7 @@ const char *gen_path(const char *directory, const char *filename, struct gc_aren |
162 | 162 |
/* return true if pathname is absolute */ |
163 | 163 |
bool absolute_pathname(const char *pathname); |
164 | 164 |
|
165 |
-/* prepend a random prefix to hostname (need ENABLE_CRYPTO) */ |
|
165 |
+/* prepend a random prefix to hostname */ |
|
166 | 166 |
const char *hostname_randomize(const char *hostname, struct gc_arena *gc); |
167 | 167 |
|
168 | 168 |
/* |
... | ... |
@@ -54,7 +54,6 @@ |
54 | 54 |
|
55 | 55 |
struct key_schedule |
56 | 56 |
{ |
57 |
-#ifdef ENABLE_CRYPTO |
|
58 | 57 |
/* which cipher, HMAC digest, and key sizes are we using? */ |
59 | 58 |
struct key_type key_type; |
60 | 59 |
|
... | ... |
@@ -67,9 +66,6 @@ struct key_schedule |
67 | 67 |
/* optional TLS control channel wrapping */ |
68 | 68 |
struct key_type tls_auth_key_type; |
69 | 69 |
struct key_ctx_bi tls_wrap_key; |
70 |
-#else /* ENABLE_CRYPTO */ |
|
71 |
- int dummy; |
|
72 |
-#endif /* ENABLE_CRYPTO */ |
|
73 | 70 |
}; |
74 | 71 |
|
75 | 72 |
/* |
... | ... |
@@ -96,10 +92,8 @@ struct context_buffers |
96 | 96 |
struct buffer aux_buf; |
97 | 97 |
|
98 | 98 |
/* workspace buffers used by crypto routines */ |
99 |
-#ifdef ENABLE_CRYPTO |
|
100 | 99 |
struct buffer encrypt_buf; |
101 | 100 |
struct buffer decrypt_buf; |
102 |
-#endif |
|
103 | 101 |
|
104 | 102 |
/* workspace buffers for compression */ |
105 | 103 |
#ifdef USE_COMP |
... | ... |
@@ -334,8 +328,6 @@ struct context_2 |
334 | 334 |
int occ_mtu_load_n_tries; |
335 | 335 |
#endif |
336 | 336 |
|
337 |
-#ifdef ENABLE_CRYPTO |
|
338 |
- |
|
339 | 337 |
/* |
340 | 338 |
* TLS-mode crypto objects. |
341 | 339 |
*/ |
... | ... |
@@ -367,8 +359,6 @@ struct context_2 |
367 | 367 |
|
368 | 368 |
struct event_timeout packet_id_persist_interval; |
369 | 369 |
|
370 |
-#endif /* ENABLE_CRYPTO */ |
|
371 |
- |
|
372 | 370 |
#ifdef USE_COMP |
373 | 371 |
struct compress_context *comp_context; |
374 | 372 |
/**< Compression context used by the |
... | ... |
@@ -566,7 +556,6 @@ struct context |
566 | 566 |
* have been compiled in. |
567 | 567 |
*/ |
568 | 568 |
|
569 |
-#ifdef ENABLE_CRYPTO |
|
570 | 569 |
#define TLS_MODE(c) ((c)->c2.tls_multi != NULL) |
571 | 570 |
#define PROTO_DUMP_FLAGS (check_debug_level(D_LINK_RW_VERBOSE) ? (PD_SHOW_DATA|PD_VERBOSE) : 0) |
572 | 571 |
#define PROTO_DUMP(buf, gc) protocol_dump((buf), \ |
... | ... |
@@ -574,22 +563,9 @@ struct context |
574 | 574 |
|(c->c2.tls_multi ? PD_TLS : 0) \ |
575 | 575 |
|(c->options.tls_auth_file ? c->c1.ks.key_type.hmac_length : 0), \ |
576 | 576 |
gc) |
577 |
-#else /* ifdef ENABLE_CRYPTO */ |
|
578 |
-#define TLS_MODE(c) (false) |
|
579 |
-#define PROTO_DUMP(buf, gc) format_hex(BPTR(buf), BLEN(buf), 80, gc) |
|
580 |
-#endif |
|
581 |
- |
|
582 |
-#ifdef ENABLE_CRYPTO |
|
583 | 577 |
#define MD5SUM(buf, len, gc) md5sum((buf), (len), 0, (gc)) |
584 |
-#else |
|
585 |
-#define MD5SUM(buf, len, gc) "[unavailable]" |
|
586 |
-#endif |
|
587 | 578 |
|
588 |
-#ifdef ENABLE_CRYPTO |
|
589 | 579 |
#define CIPHER_ENABLED(c) (c->c1.ks.key_type.cipher != NULL) |
590 |
-#else |
|
591 |
-#define CIPHER_ENABLED(c) (false) |
|
592 |
-#endif |
|
593 | 580 |
|
594 | 581 |
/* this represents "disabled peer-id" */ |
595 | 582 |
#define MAX_PEER_ID 0xFFFFFF |
... | ... |
@@ -67,7 +67,6 @@ const char title_string[] = |
67 | 67 |
" [git:" CONFIGURE_GIT_REVISION CONFIGURE_GIT_FLAGS "]" |
68 | 68 |
#endif |
69 | 69 |
" " TARGET_ALIAS |
70 |
-#ifdef ENABLE_CRYPTO |
|
71 | 70 |
#if defined(ENABLE_CRYPTO_MBEDTLS) |
72 | 71 |
" [SSL (mbed TLS)]" |
73 | 72 |
#elif defined(ENABLE_CRYPTO_OPENSSL) |
... | ... |
@@ -75,7 +74,6 @@ const char title_string[] = |
75 | 75 |
#else |
76 | 76 |
" [SSL]" |
77 | 77 |
#endif /* defined(ENABLE_CRYPTO_MBEDTLS) */ |
78 |
-#endif /* ENABLE_CRYPTO */ |
|
79 | 78 |
#ifdef USE_COMP |
80 | 79 |
#ifdef ENABLE_LZO |
81 | 80 |
" [LZO]" |
... | ... |
@@ -518,7 +516,6 @@ static const char usage_message[] = |
518 | 518 |
"--explicit-exit-notify [n] : On exit/restart, send exit signal to\n" |
519 | 519 |
" server/remote. n = # of retries, default=1.\n" |
520 | 520 |
#endif |
521 |
-#ifdef ENABLE_CRYPTO |
|
522 | 521 |
"\n" |
523 | 522 |
"Data Channel Encryption Options (must be compatible between peers):\n" |
524 | 523 |
"(These options are meaningful for both Static Key & TLS-mode)\n" |
... | ... |
@@ -748,7 +745,6 @@ static const char usage_message[] = |
748 | 748 |
"--genkey : Generate a random key to be used as a shared secret,\n" |
749 | 749 |
" for use with the --secret option.\n" |
750 | 750 |
"--secret file : Write key to file.\n" |
751 |
-#endif /* ENABLE_CRYPTO */ |
|
752 | 751 |
#ifdef ENABLE_FEATURE_TUN_PERSIST |
753 | 752 |
"\n" |
754 | 753 |
"Tun/tap config mode (available with linux 2.4+):\n" |
... | ... |
@@ -852,7 +848,6 @@ init_options(struct options *o, const bool init_gc) |
852 | 852 |
#if P2MP |
853 | 853 |
o->scheduled_exit_interval = 5; |
854 | 854 |
#endif |
855 |
-#ifdef ENABLE_CRYPTO |
|
856 | 855 |
o->ciphername = "BF-CBC"; |
857 | 856 |
#ifdef HAVE_AEAD_CIPHER_MODES /* IV_NCP=2 requires GCM support */ |
858 | 857 |
o->ncp_enabled = true; |
... | ... |
@@ -882,7 +877,6 @@ init_options(struct options *o, const bool init_gc) |
882 | 882 |
#ifdef ENABLE_X509ALTUSERNAME |
883 | 883 |
o->x509_username_field = X509_USERNAME_FIELD_DEFAULT; |
884 | 884 |
#endif |
885 |
-#endif /* ENABLE_CRYPTO */ |
|
886 | 885 |
#ifdef ENABLE_PKCS11 |
887 | 886 |
o->pkcs11_pin_cache_period = -1; |
888 | 887 |
#endif /* ENABLE_PKCS11 */ |
... | ... |
@@ -1146,7 +1140,6 @@ string_substitute(const char *src, int from, int to, struct gc_arena *gc) |
1146 | 1146 |
return ret; |
1147 | 1147 |
} |
1148 | 1148 |
|
1149 |
-#ifdef ENABLE_CRYPTO |
|
1150 | 1149 |
static uint8_t * |
1151 | 1150 |
parse_hash_fingerprint(const char *str, int nbytes, int msglevel, struct gc_arena *gc) |
1152 | 1151 |
{ |
... | ... |
@@ -1188,7 +1181,6 @@ parse_hash_fingerprint(const char *str, int nbytes, int msglevel, struct gc_aren |
1188 | 1188 |
} |
1189 | 1189 |
return ret; |
1190 | 1190 |
} |
1191 |
-#endif /* ifdef ENABLE_CRYPTO */ |
|
1192 | 1191 |
|
1193 | 1192 |
#ifdef _WIN32 |
1194 | 1193 |
|
... | ... |
@@ -1560,14 +1552,12 @@ show_settings(const struct options *o) |
1560 | 1560 |
SHOW_INT(persist_mode); |
1561 | 1561 |
#endif |
1562 | 1562 |
|
1563 |
-#ifdef ENABLE_CRYPTO |
|
1564 | 1563 |
SHOW_BOOL(show_ciphers); |
1565 | 1564 |
SHOW_BOOL(show_digests); |
1566 | 1565 |
SHOW_BOOL(show_engines); |
1567 | 1566 |
SHOW_BOOL(genkey); |
1568 | 1567 |
SHOW_STR(key_pass_file); |
1569 | 1568 |
SHOW_BOOL(show_tls_ciphers); |
1570 |
-#endif |
|
1571 | 1569 |
|
1572 | 1570 |
SHOW_INT(connect_retry_max); |
1573 | 1571 |
show_connection_entries(o); |
... | ... |
@@ -1702,7 +1692,6 @@ show_settings(const struct options *o) |
1702 | 1702 |
} |
1703 | 1703 |
#endif |
1704 | 1704 |
|
1705 |
-#ifdef ENABLE_CRYPTO |
|
1706 | 1705 |
SHOW_STR(shared_secret_file); |
1707 | 1706 |
SHOW_INT(key_direction); |
1708 | 1707 |
SHOW_STR(ciphername); |
... | ... |
@@ -1790,7 +1779,6 @@ show_settings(const struct options *o) |
1790 | 1790 |
|
1791 | 1791 |
SHOW_STR(tls_auth_file); |
1792 | 1792 |
SHOW_STR(tls_crypt_file); |
1793 |
-#endif /* ENABLE_CRYPTO */ |
|
1794 | 1793 |
|
1795 | 1794 |
#ifdef ENABLE_PKCS11 |
1796 | 1795 |
{ |
... | ... |
@@ -2024,14 +2012,14 @@ options_postprocess_verify_ce(const struct options *options, const struct connec |
2024 | 2024 |
|
2025 | 2025 |
init_options(&defaults, true); |
2026 | 2026 |
|
2027 |
-#ifdef ENABLE_CRYPTO |
|
2028 | 2027 |
if (options->test_crypto) |
2029 | 2028 |
{ |
2030 | 2029 |
notnull(options->shared_secret_file, "key file (--secret)"); |
2031 | 2030 |
} |
2032 | 2031 |
else |
2033 |
-#endif |
|
2034 |
- notnull(options->dev, "TUN/TAP device (--dev)"); |
|
2032 |
+ { |
|
2033 |
+ notnull(options->dev, "TUN/TAP device (--dev)"); |
|
2034 |
+ } |
|
2035 | 2035 |
|
2036 | 2036 |
/* |
2037 | 2037 |
* Get tun/tap/null device type |
... | ... |
@@ -2072,10 +2060,7 @@ options_postprocess_verify_ce(const struct options *options, const struct connec |
2072 | 2072 |
} |
2073 | 2073 |
|
2074 | 2074 |
if (options->inetd == INETD_NOWAIT |
2075 |
-#ifdef ENABLE_CRYPTO |
|
2076 |
- && !(options->tls_server || options->tls_client) |
|
2077 |
-#endif |
|
2078 |
- ) |
|
2075 |
+ && !(options->tls_server || options->tls_client)) |
|
2079 | 2076 |
{ |
2080 | 2077 |
msg(M_USAGE, "--inetd nowait can only be used in TLS mode"); |
2081 | 2078 |
} |
... | ... |
@@ -2485,8 +2470,6 @@ options_postprocess_verify_ce(const struct options *options, const struct connec |
2485 | 2485 |
} |
2486 | 2486 |
#endif /* P2MP_SERVER */ |
2487 | 2487 |
|
2488 |
-#ifdef ENABLE_CRYPTO |
|
2489 |
- |
|
2490 | 2488 |
if (options->ncp_enabled && !tls_check_ncp_cipher_list(options->ncp_ciphers)) |
2491 | 2489 |
{ |
2492 | 2490 |
msg(M_USAGE, "NCP cipher list contains unsupported ciphers."); |
... | ... |
@@ -2771,7 +2754,6 @@ options_postprocess_verify_ce(const struct options *options, const struct connec |
2771 | 2771 |
} |
2772 | 2772 |
} |
2773 | 2773 |
#undef MUST_BE_UNDEF |
2774 |
-#endif /* ENABLE_CRYPTO */ |
|
2775 | 2774 |
|
2776 | 2775 |
#if P2MP |
2777 | 2776 |
if (options->auth_user_pass_file && !options->pull) |
... | ... |
@@ -3009,7 +2991,6 @@ options_postprocess_mutate(struct options *o) |
3009 | 3009 |
options_postprocess_mutate_ce(o, o->connection_list->array[i]); |
3010 | 3010 |
} |
3011 | 3011 |
|
3012 |
-#ifdef ENABLE_CRYPTO |
|
3013 | 3012 |
if (o->tls_server) |
3014 | 3013 |
{ |
3015 | 3014 |
/* Check that DH file is specified, or explicitly disabled */ |
... | ... |
@@ -3035,7 +3016,6 @@ options_postprocess_mutate(struct options *o) |
3035 | 3035 |
"in P2MP client or server mode" ); |
3036 | 3036 |
o->ncp_enabled = false; |
3037 | 3037 |
} |
3038 |
-#endif |
|
3039 | 3038 |
|
3040 | 3039 |
#if ENABLE_MANAGEMENT |
3041 | 3040 |
if (o->http_proxy_override) |
... | ... |
@@ -3267,7 +3247,6 @@ options_postprocess_filechecks(struct options *options) |
3267 | 3267 |
{ |
3268 | 3268 |
bool errs = false; |
3269 | 3269 |
|
3270 |
-#ifdef ENABLE_CRYPTO |
|
3271 | 3270 |
/* ** SSL/TLS/crypto related files ** */ |
3272 | 3271 |
errs |= check_file_access(CHKACC_FILE|CHKACC_INLINE, options->dh_file, R_OK, "--dh"); |
3273 | 3272 |
errs |= check_file_access(CHKACC_FILE|CHKACC_INLINE, options->ca_file, R_OK, "--ca"); |
... | ... |
@@ -3308,7 +3287,6 @@ options_postprocess_filechecks(struct options *options) |
3308 | 3308 |
/* ** Password files ** */ |
3309 | 3309 |
errs |= check_file_access(CHKACC_FILE|CHKACC_ACPTSTDIN|CHKACC_PRIVATE, |
3310 | 3310 |
options->key_pass_file, R_OK, "--askpass"); |
3311 |
-#endif /* ENABLE_CRYPTO */ |
|
3312 | 3311 |
#ifdef ENABLE_MANAGEMENT |
3313 | 3312 |
errs |= check_file_access(CHKACC_FILE|CHKACC_ACPTSTDIN|CHKACC_PRIVATE, |
3314 | 3313 |
options->management_user_pass, R_OK, |
... | ... |
@@ -3331,10 +3309,8 @@ options_postprocess_filechecks(struct options *options) |
3331 | 3331 |
R_OK|W_OK, "--status"); |
3332 | 3332 |
|
3333 | 3333 |
/* ** Config related ** */ |
3334 |
-#ifdef ENABLE_CRYPTO |
|
3335 | 3334 |
errs |= check_file_access_chroot(options->chroot_dir, CHKACC_FILE, options->tls_export_cert, |
3336 | 3335 |
R_OK|W_OK|X_OK, "--tls-export-cert"); |
3337 |
-#endif /* ENABLE_CRYPTO */ |
|
3338 | 3336 |
#if P2MP_SERVER |
3339 | 3337 |
errs |= check_file_access_chroot(options->chroot_dir, CHKACC_FILE, options->client_config_dir, |
3340 | 3338 |
R_OK|X_OK, "--client-config-dir"); |
... | ... |
@@ -3462,7 +3438,7 @@ static size_t |
3462 | 3462 |
calc_options_string_link_mtu(const struct options *o, const struct frame *frame) |
3463 | 3463 |
{ |
3464 | 3464 |
size_t link_mtu = EXPANDED_SIZE(frame); |
3465 |
-#ifdef ENABLE_CRYPTO |
|
3465 |
+ |
|
3466 | 3466 |
if (o->pull || o->mode == MODE_SERVER) |
3467 | 3467 |
{ |
3468 | 3468 |
struct frame fake_frame = *frame; |
... | ... |
@@ -3478,7 +3454,6 @@ calc_options_string_link_mtu(const struct options *o, const struct frame *frame) |
3478 | 3478 |
EXPANDED_SIZE(&fake_frame)); |
3479 | 3479 |
link_mtu = EXPANDED_SIZE(&fake_frame); |
3480 | 3480 |
} |
3481 |
-#endif |
|
3482 | 3481 |
return link_mtu; |
3483 | 3482 |
} |
3484 | 3483 |
|
... | ... |
@@ -3606,8 +3581,6 @@ options_string(const struct options *o, |
3606 | 3606 |
} |
3607 | 3607 |
#endif |
3608 | 3608 |
|
3609 |
-#ifdef ENABLE_CRYPTO |
|
3610 |
- |
|
3611 | 3609 |
#define TLS_CLIENT (o->tls_client) |
3612 | 3610 |
#define TLS_SERVER (o->tls_server) |
3613 | 3611 |
|
... | ... |
@@ -3705,8 +3678,6 @@ options_string(const struct options *o, |
3705 | 3705 |
#undef TLS_CLIENT |
3706 | 3706 |
#undef TLS_SERVER |
3707 | 3707 |
|
3708 |
-#endif /* ENABLE_CRYPTO */ |
|
3709 |
- |
|
3710 | 3708 |
return BSTR(&out); |
3711 | 3709 |
} |
3712 | 3710 |
|
... | ... |
@@ -4084,7 +4055,6 @@ usage(void) |
4084 | 4084 |
struct options o; |
4085 | 4085 |
init_options(&o, true); |
4086 | 4086 |
|
4087 |
-#ifdef ENABLE_CRYPTO |
|
4088 | 4087 |
fprintf(fp, usage_message, |
4089 | 4088 |
title_string, |
4090 | 4089 |
o.ce.connect_retry_seconds, |
... | ... |
@@ -4096,15 +4066,6 @@ usage(void) |
4096 | 4096 |
o.replay_window, o.replay_time, |
4097 | 4097 |
o.tls_timeout, o.renegotiate_seconds, |
4098 | 4098 |
o.handshake_window, o.transition_window); |
4099 |
-#else /* ifdef ENABLE_CRYPTO */ |
|
4100 |
- fprintf(fp, usage_message, |
|
4101 |
- title_string, |
|
4102 |
- o.ce.connect_retry_seconds, |
|
4103 |
- o.ce.connect_retry_seconds_max, |
|
4104 |
- o.ce.local_port, o.ce.remote_port, |
|
4105 |
- TUN_MTU_DEFAULT, TAP_MTU_EXTRA_DEFAULT, |
|
4106 |
- o.verbosity); |
|
4107 |
-#endif |
|
4108 | 4099 |
fflush(fp); |
4109 | 4100 |
|
4110 | 4101 |
#endif /* ENABLE_SMALL */ |
... | ... |
@@ -4132,11 +4093,7 @@ show_windows_version(const unsigned int flags) |
4132 | 4132 |
void |
4133 | 4133 |
show_library_versions(const unsigned int flags) |
4134 | 4134 |
{ |
4135 |
-#ifdef ENABLE_CRYPTO |
|
4136 | 4135 |
#define SSL_LIB_VER_STR get_ssl_library_version() |
4137 |
-#else |
|
4138 |
-#define SSL_LIB_VER_STR "" |
|
4139 |
-#endif |
|
4140 | 4136 |
#ifdef ENABLE_LZO |
4141 | 4137 |
#define LZO_LIB_VER_STR ", LZO ", lzo_version_string() |
4142 | 4138 |
#else |
... | ... |
@@ -7441,7 +7398,6 @@ add_option(struct options *options, |
7441 | 7441 |
} |
7442 | 7442 |
} |
7443 | 7443 |
#endif /* USE_COMP */ |
7444 |
-#ifdef ENABLE_CRYPTO |
|
7445 | 7444 |
else if (streq(p[0], "show-ciphers") && !p[1]) |
7446 | 7445 |
{ |
7447 | 7446 |
VERIFY_PERMISSION(OPT_P_GENERAL); |
... | ... |
@@ -8124,7 +8080,6 @@ add_option(struct options *options, |
8124 | 8124 |
options->x509_username_field = p[1]; |
8125 | 8125 |
} |
8126 | 8126 |
#endif /* ENABLE_X509ALTUSERNAME */ |
8127 |
-#endif /* ENABLE_CRYPTO */ |
|
8128 | 8127 |
#ifdef ENABLE_PKCS11 |
8129 | 8128 |
else if (streq(p[0], "show-pkcs11-ids") && !p[3]) |
8130 | 8129 |
{ |
... | ... |
@@ -41,9 +41,7 @@ |
41 | 41 |
#include "comp.h" |
42 | 42 |
#include "pushlist.h" |
43 | 43 |
#include "clinat.h" |
44 |
-#ifdef ENABLE_CRYPTO |
|
45 | 44 |
#include "crypto_backend.h" |
46 |
-#endif |
|
47 | 45 |
|
48 | 46 |
|
49 | 47 |
/* |
... | ... |
@@ -81,7 +79,7 @@ struct options_pre_pull |
81 | 81 |
}; |
82 | 82 |
|
83 | 83 |
#endif |
84 |
-#if defined(ENABLE_CRYPTO) && !defined(ENABLE_CRYPTO_OPENSSL) && !defined(ENABLE_CRYPTO_MBEDTLS) |
|
84 |
+#if !defined(ENABLE_CRYPTO_OPENSSL) && !defined(ENABLE_CRYPTO_MBEDTLS) |
|
85 | 85 |
#error "At least one of OpenSSL or mbed TLS needs to be defined." |
86 | 86 |
#endif |
87 | 87 |
|
... | ... |
@@ -188,7 +186,6 @@ struct options |
188 | 188 |
bool persist_config; |
189 | 189 |
int persist_mode; |
190 | 190 |
|
191 |
-#ifdef ENABLE_CRYPTO |
|
192 | 191 |
const char *key_pass_file; |
193 | 192 |
bool show_ciphers; |
194 | 193 |
bool show_digests; |
... | ... |
@@ -196,7 +193,6 @@ struct options |
196 | 196 |
bool show_tls_ciphers; |
197 | 197 |
bool show_curves; |
198 | 198 |
bool genkey; |
199 |
-#endif |
|
200 | 199 |
|
201 | 200 |
/* Networking parms */ |
202 | 201 |
int connect_retry_max; |
... | ... |
@@ -468,7 +464,6 @@ struct options |
468 | 468 |
#endif |
469 | 469 |
#endif /* if P2MP */ |
470 | 470 |
|
471 |
-#ifdef ENABLE_CRYPTO |
|
472 | 471 |
/* Cipher parms */ |
473 | 472 |
const char *shared_secret_file; |
474 | 473 |
const char *shared_secret_file_inline; |
... | ... |
@@ -580,8 +575,6 @@ struct options |
580 | 580 |
|
581 | 581 |
bool tls_exit; |
582 | 582 |
|
583 |
-#endif /* ENABLE_CRYPTO */ |
|
584 |
- |
|
585 | 583 |
const struct x509_track *x509_track; |
586 | 584 |
|
587 | 585 |
/* special state parms */ |
... | ... |
@@ -38,8 +38,6 @@ |
38 | 38 |
|
39 | 39 |
#include "syshead.h" |
40 | 40 |
|
41 |
-#ifdef ENABLE_CRYPTO |
|
42 |
- |
|
43 | 41 |
#include "packet_id.h" |
44 | 42 |
#include "misc.h" |
45 | 43 |
#include "integer.h" |
... | ... |
@@ -695,5 +693,3 @@ packet_id_interactive_test(void) |
695 | 695 |
packet_id_free(&pid); |
696 | 696 |
} |
697 | 697 |
#endif /* ifdef PID_TEST */ |
698 |
- |
|
699 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -27,8 +27,6 @@ |
27 | 27 |
* attempts to replay them back later. |
28 | 28 |
*/ |
29 | 29 |
|
30 |
-#ifdef ENABLE_CRYPTO |
|
31 |
- |
|
32 | 30 |
#ifndef PACKET_ID_H |
33 | 31 |
#define PACKET_ID_H |
34 | 32 |
|
... | ... |
@@ -342,4 +340,3 @@ packet_id_reap_test(struct packet_id_rec *p) |
342 | 342 |
} |
343 | 343 |
|
344 | 344 |
#endif /* PACKET_ID_H */ |
345 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -517,11 +517,9 @@ plugin_call_item(const struct plugin *p, |
517 | 517 |
const int type, |
518 | 518 |
const struct argv *av, |
519 | 519 |
struct openvpn_plugin_string_list **retlist, |
520 |
- const char **envp |
|
521 |
-#ifdef ENABLE_CRYPTO |
|
522 |
- , int certdepth, |
|
520 |
+ const char **envp, |
|
521 |
+ int certdepth, |
|
523 | 522 |
openvpn_x509_cert_t *current_cert |
524 |
-#endif |
|
525 | 523 |
) |
526 | 524 |
{ |
527 | 525 |
int status = OPENVPN_PLUGIN_FUNC_SUCCESS; |
... | ... |
@@ -550,13 +548,8 @@ plugin_call_item(const struct plugin *p, |
550 | 550 |
(const char **const) envp, |
551 | 551 |
p->plugin_handle, |
552 | 552 |
per_client_context, |
553 |
-#ifdef ENABLE_CRYPTO |
|
554 | 553 |
(current_cert ? certdepth : -1), |
555 | 554 |
current_cert |
556 |
-#else |
|
557 |
- -1, |
|
558 |
- NULL |
|
559 |
-#endif |
|
560 | 555 |
}; |
561 | 556 |
|
562 | 557 |
struct openvpn_plugin_args_func_return retargs; |
... | ... |
@@ -786,11 +779,9 @@ plugin_call_ssl(const struct plugin_list *pl, |
786 | 786 |
const int type, |
787 | 787 |
const struct argv *av, |
788 | 788 |
struct plugin_return *pr, |
789 |
- struct env_set *es |
|
790 |
-#ifdef ENABLE_CRYPTO |
|
791 |
- , int certdepth, |
|
789 |
+ struct env_set *es, |
|
790 |
+ int certdepth, |
|
792 | 791 |
openvpn_x509_cert_t *current_cert |
793 |
-#endif |
|
794 | 792 |
) |
795 | 793 |
{ |
796 | 794 |
if (pr) |
... | ... |
@@ -818,11 +809,9 @@ plugin_call_ssl(const struct plugin_list *pl, |
818 | 818 |
type, |
819 | 819 |
av, |
820 | 820 |
pr ? &pr->list[i] : NULL, |
821 |
- envp |
|
822 |
-#ifdef ENABLE_CRYPTO |
|
823 |
- ,certdepth, |
|
821 |
+ envp, |
|
822 |
+ certdepth, |
|
824 | 823 |
current_cert |
825 |
-#endif |
|
826 | 824 |
); |
827 | 825 |
switch (status) |
828 | 826 |
{ |
... | ... |
@@ -127,11 +127,9 @@ int plugin_call_ssl(const struct plugin_list *pl, |
127 | 127 |
const int type, |
128 | 128 |
const struct argv *av, |
129 | 129 |
struct plugin_return *pr, |
130 |
- struct env_set *es |
|
131 |
-#ifdef ENABLE_CRYPTO |
|
132 |
- , int current_cert_depth, |
|
130 |
+ struct env_set *es, |
|
131 |
+ int current_cert_depth, |
|
133 | 132 |
openvpn_x509_cert_t *current_cert |
134 |
-#endif |
|
135 | 133 |
); |
136 | 134 |
|
137 | 135 |
void plugin_list_close(struct plugin_list *pl); |
... | ... |
@@ -189,11 +187,9 @@ plugin_call_ssl(const struct plugin_list *pl, |
189 | 189 |
const int type, |
190 | 190 |
const struct argv *av, |
191 | 191 |
struct plugin_return *pr, |
192 |
- struct env_set *es |
|
193 |
-#ifdef ENABLE_CRYPTO |
|
194 |
- , int current_cert_depth, |
|
192 |
+ struct env_set *es, |
|
193 |
+ int current_cert_depth, |
|
195 | 194 |
openvpn_x509_cert_t *current_cert |
196 |
-#endif |
|
197 | 195 |
) |
198 | 196 |
{ |
199 | 197 |
return 0; |
... | ... |
@@ -208,11 +204,7 @@ plugin_call(const struct plugin_list *pl, |
208 | 208 |
struct plugin_return *pr, |
209 | 209 |
struct env_set *es) |
210 | 210 |
{ |
211 |
- return plugin_call_ssl(pl, type, av, pr, es |
|
212 |
-#ifdef ENABLE_CRYPTO |
|
213 |
- , -1, NULL |
|
214 |
-#endif |
|
215 |
- ); |
|
211 |
+ return plugin_call_ssl(pl, type, av, pr, es, -1, NULL); |
|
216 | 212 |
} |
217 | 213 |
|
218 | 214 |
#endif /* OPENVPN_PLUGIN_H */ |
... | ... |
@@ -34,8 +34,6 @@ |
34 | 34 |
|
35 | 35 |
#include "syshead.h" |
36 | 36 |
|
37 |
-#ifdef ENABLE_CRYPTO |
|
38 |
- |
|
39 | 37 |
#include "buffer.h" |
40 | 38 |
#include "error.h" |
41 | 39 |
#include "common.h" |
... | ... |
@@ -802,10 +800,3 @@ reliable_debug_print(const struct reliable *rel, char *desc) |
802 | 802 |
} |
803 | 803 |
|
804 | 804 |
#endif /* if 0 */ |
805 |
- |
|
806 |
-#else /* ifdef ENABLE_CRYPTO */ |
|
807 |
-static void |
|
808 |
-dummy(void) |
|
809 |
-{ |
|
810 |
-} |
|
811 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -28,8 +28,6 @@ |
28 | 28 |
*/ |
29 | 29 |
|
30 | 30 |
|
31 |
-#ifdef ENABLE_CRYPTO |
|
32 |
- |
|
33 | 31 |
#ifndef RELIABLE_H |
34 | 32 |
#define RELIABLE_H |
35 | 33 |
|
... | ... |
@@ -476,4 +474,3 @@ void reliable_ack_debug_print(const struct reliable_ack *ack, char *desc); |
476 | 476 |
|
477 | 477 |
|
478 | 478 |
#endif /* RELIABLE_H */ |
479 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -38,8 +38,6 @@ |
38 | 38 |
|
39 | 39 |
#include "syshead.h" |
40 | 40 |
|
41 |
-#ifdef ENABLE_CRYPTO |
|
42 |
- |
|
43 | 41 |
#include "error.h" |
44 | 42 |
#include "common.h" |
45 | 43 |
#include "crypto.h" |
... | ... |
@@ -60,10 +58,3 @@ session_id_print(const struct session_id *sid, struct gc_arena *gc) |
60 | 60 |
{ |
61 | 61 |
return format_hex(sid->id, SID_SIZE, 0, gc); |
62 | 62 |
} |
63 |
- |
|
64 |
-#else /* ifdef ENABLE_CRYPTO */ |
|
65 |
-static void |
|
66 |
-dummy(void) |
|
67 |
-{ |
|
68 |
-} |
|
69 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -29,8 +29,6 @@ |
29 | 29 |
* negotiated). |
30 | 30 |
*/ |
31 | 31 |
|
32 |
-#ifdef ENABLE_CRYPTO |
|
33 |
- |
|
34 | 32 |
#ifndef SESSION_ID_H |
35 | 33 |
#define SESSION_ID_H |
36 | 34 |
|
... | ... |
@@ -82,4 +80,3 @@ void session_id_random(struct session_id *sid); |
82 | 82 |
const char *session_id_print(const struct session_id *sid, struct gc_arena *gc); |
83 | 83 |
|
84 | 84 |
#endif /* SESSION_ID_H */ |
85 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -43,8 +43,6 @@ |
43 | 43 |
#include "syshead.h" |
44 | 44 |
#include "win32.h" |
45 | 45 |
|
46 |
-#if defined(ENABLE_CRYPTO) |
|
47 |
- |
|
48 | 46 |
#include "error.h" |
49 | 47 |
#include "common.h" |
50 | 48 |
#include "socket.h" |
... | ... |
@@ -4245,10 +4243,3 @@ delayed_auth_pass_purge(void) |
4245 | 4245 |
auth_user_pass.wait_for_push = false; |
4246 | 4246 |
purge_user_pass(&auth_user_pass, false); |
4247 | 4247 |
} |
4248 |
- |
|
4249 |
-#else /* if defined(ENABLE_CRYPTO) */ |
|
4250 |
-static void |
|
4251 |
-dummy(void) |
|
4252 |
-{ |
|
4253 |
-} |
|
4254 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -29,8 +29,6 @@ |
29 | 29 |
#ifndef OPENVPN_SSL_H |
30 | 30 |
#define OPENVPN_SSL_H |
31 | 31 |
|
32 |
-#if defined(ENABLE_CRYPTO) |
|
33 |
- |
|
34 | 32 |
#include "basic.h" |
35 | 33 |
#include "common.h" |
36 | 34 |
#include "crypto.h" |
... | ... |
@@ -600,6 +598,4 @@ bool is_hard_reset(int op, int key_method); |
600 | 600 |
|
601 | 601 |
void delayed_auth_pass_purge(void); |
602 | 602 |
|
603 |
-#endif /* ENABLE_CRYPTO */ |
|
604 |
- |
|
605 | 603 |
#endif /* ifndef OPENVPN_SSL_H */ |
... | ... |
@@ -124,8 +124,6 @@ int tls_version_parse(const char *vstr, const char *extra); |
124 | 124 |
*/ |
125 | 125 |
int tls_version_max(void); |
126 | 126 |
|
127 |
-#ifdef ENABLE_CRYPTO |
|
128 |
- |
|
129 | 127 |
/** |
130 | 128 |
* Initialise a library-specific TLS context for a server. |
131 | 129 |
* |
... | ... |
@@ -539,5 +537,4 @@ void get_highest_preference_tls_cipher(char *buf, int size); |
539 | 539 |
*/ |
540 | 540 |
const char *get_ssl_library_version(void); |
541 | 541 |
|
542 |
-#endif /* ENABLE_CRYPTO */ |
|
543 | 542 |
#endif /* SSL_BACKEND_H_ */ |
... | ... |
@@ -35,7 +35,7 @@ |
35 | 35 |
|
36 | 36 |
#include "syshead.h" |
37 | 37 |
|
38 |
-#if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_MBEDTLS) |
|
38 |
+#if defined(ENABLE_CRYPTO_MBEDTLS) |
|
39 | 39 |
|
40 | 40 |
#include "errlevel.h" |
41 | 41 |
#include "ssl_backend.h" |
... | ... |
@@ -1395,4 +1395,4 @@ get_ssl_library_version(void) |
1395 | 1395 |
return mbedtls_version; |
1396 | 1396 |
} |
1397 | 1397 |
|
1398 |
-#endif /* defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_MBEDTLS) */ |
|
1398 |
+#endif /* defined(ENABLE_CRYPTO_MBEDTLS) */ |
... | ... |
@@ -34,7 +34,7 @@ |
34 | 34 |
|
35 | 35 |
#include "syshead.h" |
36 | 36 |
|
37 |
-#if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) |
|
37 |
+#if defined(ENABLE_CRYPTO_OPENSSL) |
|
38 | 38 |
|
39 | 39 |
#include "errlevel.h" |
40 | 40 |
#include "buffer.h" |
... | ... |
@@ -1874,4 +1874,4 @@ get_ssl_library_version(void) |
1874 | 1874 |
return SSLeay_version(SSLEAY_VERSION); |
1875 | 1875 |
} |
1876 | 1876 |
|
1877 |
-#endif /* defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) */ |
|
1877 |
+#endif /* defined(ENABLE_CRYPTO_OPENSSL) */ |
... | ... |
@@ -34,8 +34,6 @@ |
34 | 34 |
|
35 | 35 |
#include "syshead.h" |
36 | 36 |
|
37 |
-#ifdef ENABLE_CRYPTO |
|
38 |
- |
|
39 | 37 |
#include "misc.h" |
40 | 38 |
#include "manage.h" |
41 | 39 |
#include "otime.h" |
... | ... |
@@ -1541,5 +1539,3 @@ tls_x509_clear_env(struct env_set *es) |
1541 | 1541 |
item = next; |
1542 | 1542 |
} |
1543 | 1543 |
} |
1544 |
- |
|
1545 |
-#endif /* ENABLE_CRYPTO */ |
... | ... |
@@ -29,8 +29,6 @@ |
29 | 29 |
#ifndef SSL_VERIFY_H_ |
30 | 30 |
#define SSL_VERIFY_H_ |
31 | 31 |
|
32 |
-#ifdef ENABLE_CRYPTO |
|
33 |
- |
|
34 | 32 |
#include "syshead.h" |
35 | 33 |
#include "misc.h" |
36 | 34 |
#include "ssl_common.h" |
... | ... |
@@ -243,6 +241,4 @@ tls_client_reason(struct tls_multi *multi) |
243 | 243 |
/** Remove any X509_ env variables from env_set es */ |
244 | 244 |
void tls_x509_clear_env(struct env_set *es); |
245 | 245 |
|
246 |
-#endif /* ENABLE_CRYPTO */ |
|
247 |
- |
|
248 | 246 |
#endif /* SSL_VERIFY_H_ */ |
... | ... |
@@ -34,7 +34,7 @@ |
34 | 34 |
|
35 | 35 |
#include "syshead.h" |
36 | 36 |
|
37 |
-#if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_MBEDTLS) |
|
37 |
+#if defined(ENABLE_CRYPTO_MBEDTLS) |
|
38 | 38 |
|
39 | 39 |
#include "crypto_mbedtls.h" |
40 | 40 |
#include "ssl_verify.h" |
... | ... |
@@ -550,4 +550,4 @@ tls_verify_crl_missing(const struct tls_options *opt) |
550 | 550 |
return false; |
551 | 551 |
} |
552 | 552 |
|
553 |
-#endif /* #if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_MBEDTLS) */ |
|
553 |
+#endif /* #if defined(ENABLE_CRYPTO_MBEDTLS) */ |
... | ... |
@@ -34,7 +34,7 @@ |
34 | 34 |
|
35 | 35 |
#include "syshead.h" |
36 | 36 |
|
37 |
-#if defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) |
|
37 |
+#if defined(ENABLE_CRYPTO_OPENSSL) |
|
38 | 38 |
|
39 | 39 |
#include "ssl_verify_openssl.h" |
40 | 40 |
|
... | ... |
@@ -800,4 +800,4 @@ tls_verify_crl_missing(const struct tls_options *opt) |
800 | 800 |
return true; |
801 | 801 |
} |
802 | 802 |
|
803 |
-#endif /* defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) */ |
|
803 |
+#endif /* defined(ENABLE_CRYPTO_OPENSSL) */ |
... | ... |
@@ -513,7 +513,7 @@ socket_defined(const socket_descriptor_t sd) |
513 | 513 |
* Do we have point-to-multipoint capability? |
514 | 514 |
*/ |
515 | 515 |
|
516 |
-#if defined(ENABLE_CRYPTO) && defined(HAVE_GETTIMEOFDAY_NANOSECONDS) |
|
516 |
+#if defined(HAVE_GETTIMEOFDAY_NANOSECONDS) |
|
517 | 517 |
#define P2MP 1 |
518 | 518 |
#else |
519 | 519 |
#define P2MP 0 |
... | ... |
@@ -550,7 +550,7 @@ socket_defined(const socket_descriptor_t sd) |
550 | 550 |
/* |
551 | 551 |
* Enable external private key |
552 | 552 |
*/ |
553 |
-#if defined(ENABLE_MANAGEMENT) && defined(ENABLE_CRYPTO) |
|
553 |
+#if defined(ENABLE_MANAGEMENT) |
|
554 | 554 |
#define MANAGMENT_EXTERNAL_KEY |
555 | 555 |
#endif |
556 | 556 |
|
... | ... |
@@ -597,25 +597,17 @@ socket_defined(const socket_descriptor_t sd) |
597 | 597 |
/* |
598 | 598 |
* Should we include NTLM proxy functionality |
599 | 599 |
*/ |
600 |
-#if defined(ENABLE_CRYPTO) |
|
601 | 600 |
#define NTLM 1 |
602 |
-#else |
|
603 |
-#define NTLM 0 |
|
604 |
-#endif |
|
605 | 601 |
|
606 | 602 |
/* |
607 | 603 |
* Should we include proxy digest auth functionality |
608 | 604 |
*/ |
609 |
-#if defined(ENABLE_CRYPTO) |
|
610 | 605 |
#define PROXY_DIGEST_AUTH 1 |
611 |
-#else |
|
612 |
-#define PROXY_DIGEST_AUTH 0 |
|
613 |
-#endif |
|
614 | 606 |
|
615 | 607 |
/* |
616 | 608 |
* Do we have CryptoAPI capability? |
617 | 609 |
*/ |
618 |
-#if defined(_WIN32) && defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) |
|
610 |
+#if defined(_WIN32) && defined(ENABLE_CRYPTO_OPENSSL) |
|
619 | 611 |
#define ENABLE_CRYPTOAPI |
620 | 612 |
#endif |
621 | 613 |
|
... | ... |
@@ -684,9 +676,7 @@ socket_defined(const socket_descriptor_t sd) |
684 | 684 |
/* |
685 | 685 |
* Do we support pushing peer info? |
686 | 686 |
*/ |
687 |
-#if defined(ENABLE_CRYPTO) |
|
688 | 687 |
#define ENABLE_PUSH_PEER_INFO |
689 |
-#endif |
|
690 | 688 |
|
691 | 689 |
/* |
692 | 690 |
* Compression support |
... | ... |
@@ -74,8 +74,6 @@ |
74 | 74 |
#ifndef TLSCRYPT_H |
75 | 75 |
#define TLSCRYPT_H |
76 | 76 |
|
77 |
-#ifdef ENABLE_CRYPTO |
|
78 |
- |
|
79 | 77 |
#include "buffer.h" |
80 | 78 |
#include "crypto.h" |
81 | 79 |
#include "session_id.h" |
... | ... |
@@ -142,6 +140,4 @@ bool tls_crypt_unwrap(const struct buffer *src, struct buffer *dst, |
142 | 142 |
|
143 | 143 |
/** @} */ |
144 | 144 |
|
145 |
-#endif /* ENABLE_CRYPTO */ |
|
146 |
- |
|
147 | 145 |
#endif /* TLSCRYPT_H */ |