diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-06-20 23:55:34 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-06-20 23:55:34 +0300 |
commit | a7b7a32ec6dd493e00573da4b2f343f02feb0aa7 (patch) | |
tree | 2a9ec05b301f297ca1b302dcb74beb08d164aca5 /src | |
parent | 6364c4700d06232f2ea418b2146ba9e264d90086 (diff) | |
download | libmicrohttpd-a7b7a32ec6dd493e00573da4b2f343f02feb0aa7.tar.gz libmicrohttpd-a7b7a32ec6dd493e00573da4b2f343f02feb0aa7.zip |
Dropped dependency on libgcrypt with new GnuTLS (>2.12.20) versions
Diffstat (limited to 'src')
-rw-r--r-- | src/examples/https_fileserver_example.c | 2 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 7 | ||||
-rw-r--r-- | src/testcurl/https/test_empty_response.c | 2 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get_parallel.c | 2 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get_parallel_threads.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get_select.c | 2 | ||||
-rw-r--r-- | src/testcurl/https/test_https_multi_daemon.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/test_https_session_info.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/test_https_sni.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/test_https_time_out.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/test_tls_authentication.c | 4 | ||||
-rw-r--r-- | src/testcurl/https/test_tls_extensions.c | 5 | ||||
-rw-r--r-- | src/testcurl/https/test_tls_options.c | 4 | ||||
-rw-r--r-- | src/testcurl/test_digestauth.c | 4 | ||||
-rw-r--r-- | src/testcurl/test_digestauth_with_arguments.c | 4 | ||||
-rw-r--r-- | src/testcurl/test_postform.c | 4 |
17 files changed, 63 insertions, 1 deletions
diff --git a/src/examples/https_fileserver_example.c b/src/examples/https_fileserver_example.c index a36b5f70..b22b37d8 100644 --- a/src/examples/https_fileserver_example.c +++ b/src/examples/https_fileserver_example.c | |||
@@ -36,7 +36,9 @@ | |||
36 | #include <microhttpd.h> | 36 | #include <microhttpd.h> |
37 | #include <sys/stat.h> | 37 | #include <sys/stat.h> |
38 | #include <gnutls/gnutls.h> | 38 | #include <gnutls/gnutls.h> |
39 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
39 | #include <gcrypt.h> | 40 | #include <gcrypt.h> |
41 | #endif | ||
40 | 42 | ||
41 | #define BUF_SIZE 1024 | 43 | #define BUF_SIZE 1024 |
42 | #define MAX_URL_LEN 255 | 44 | #define MAX_URL_LEN 255 |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 45ecd804..1f349a26 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -47,7 +47,9 @@ | |||
47 | 47 | ||
48 | #ifdef HTTPS_SUPPORT | 48 | #ifdef HTTPS_SUPPORT |
49 | #include "connection_https.h" | 49 | #include "connection_https.h" |
50 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
50 | #include <gcrypt.h> | 51 | #include <gcrypt.h> |
52 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
51 | #endif /* HTTPS_SUPPORT */ | 53 | #endif /* HTTPS_SUPPORT */ |
52 | 54 | ||
53 | #ifdef _WIN32 | 55 | #ifdef _WIN32 |
@@ -6520,6 +6522,7 @@ MHD_is_feature_supported(enum MHD_FEATURE feature) | |||
6520 | } | 6522 | } |
6521 | 6523 | ||
6522 | 6524 | ||
6525 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
6523 | #if defined(HTTPS_SUPPORT) && GCRYPT_VERSION_NUMBER < 0x010600 | 6526 | #if defined(HTTPS_SUPPORT) && GCRYPT_VERSION_NUMBER < 0x010600 |
6524 | #if defined(MHD_USE_POSIX_THREADS) | 6527 | #if defined(MHD_USE_POSIX_THREADS) |
6525 | GCRY_THREAD_OPTION_PTHREAD_IMPL; | 6528 | GCRY_THREAD_OPTION_PTHREAD_IMPL; |
@@ -6574,7 +6577,7 @@ static struct gcry_thread_cbs gcry_threads_w32 = { | |||
6574 | 6577 | ||
6575 | #endif /* defined(MHD_W32_MUTEX_) */ | 6578 | #endif /* defined(MHD_W32_MUTEX_) */ |
6576 | #endif /* HTTPS_SUPPORT && GCRYPT_VERSION_NUMBER < 0x010600 */ | 6579 | #endif /* HTTPS_SUPPORT && GCRYPT_VERSION_NUMBER < 0x010600 */ |
6577 | 6580 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | |
6578 | 6581 | ||
6579 | /** | 6582 | /** |
6580 | * Initialize do setup work. | 6583 | * Initialize do setup work. |
@@ -6596,6 +6599,7 @@ MHD_init(void) | |||
6596 | MHD_PANIC (_("Winsock version 2.2 is not available\n")); | 6599 | MHD_PANIC (_("Winsock version 2.2 is not available\n")); |
6597 | #endif | 6600 | #endif |
6598 | #ifdef HTTPS_SUPPORT | 6601 | #ifdef HTTPS_SUPPORT |
6602 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
6599 | #if GCRYPT_VERSION_NUMBER < 0x010600 | 6603 | #if GCRYPT_VERSION_NUMBER < 0x010600 |
6600 | #if defined(MHD_USE_POSIX_THREADS) | 6604 | #if defined(MHD_USE_POSIX_THREADS) |
6601 | if (0 != gcry_control (GCRYCTL_SET_THREAD_CBS, | 6605 | if (0 != gcry_control (GCRYCTL_SET_THREAD_CBS, |
@@ -6611,6 +6615,7 @@ MHD_init(void) | |||
6611 | if (NULL == gcry_check_version ("1.6.0")) | 6615 | if (NULL == gcry_check_version ("1.6.0")) |
6612 | MHD_PANIC (_("libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 or newer\n")); | 6616 | MHD_PANIC (_("libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 or newer\n")); |
6613 | #endif | 6617 | #endif |
6618 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
6614 | gnutls_global_init (); | 6619 | gnutls_global_init (); |
6615 | #endif /* HTTPS_SUPPORT */ | 6620 | #endif /* HTTPS_SUPPORT */ |
6616 | MHD_monotonic_sec_counter_init(); | 6621 | MHD_monotonic_sec_counter_init(); |
diff --git a/src/testcurl/https/test_empty_response.c b/src/testcurl/https/test_empty_response.c index 37061b65..44ca08a4 100644 --- a/src/testcurl/https/test_empty_response.c +++ b/src/testcurl/https/test_empty_response.c | |||
@@ -28,7 +28,9 @@ | |||
28 | #include <limits.h> | 28 | #include <limits.h> |
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <curl/curl.h> | 30 | #include <curl/curl.h> |
31 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
31 | #include <gcrypt.h> | 32 | #include <gcrypt.h> |
33 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
32 | #include "tls_test_common.h" | 34 | #include "tls_test_common.h" |
33 | 35 | ||
34 | extern const char srv_key_pem[]; | 36 | extern const char srv_key_pem[]; |
diff --git a/src/testcurl/https/test_https_get.c b/src/testcurl/https/test_https_get.c index 0b82bf0f..b8cfacbe 100644 --- a/src/testcurl/https/test_https_get.c +++ b/src/testcurl/https/test_https_get.c | |||
@@ -29,7 +29,9 @@ | |||
29 | #include <limits.h> | 29 | #include <limits.h> |
30 | #include <sys/stat.h> | 30 | #include <sys/stat.h> |
31 | #include <curl/curl.h> | 31 | #include <curl/curl.h> |
32 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
32 | #include <gcrypt.h> | 33 | #include <gcrypt.h> |
34 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
33 | #include "tls_test_common.h" | 35 | #include "tls_test_common.h" |
34 | 36 | ||
35 | extern const char srv_key_pem[]; | 37 | extern const char srv_key_pem[]; |
@@ -102,10 +104,12 @@ main (int argc, char *const *argv) | |||
102 | const char *aes256_sha_tlsv1 = "AES256-SHA"; | 104 | const char *aes256_sha_tlsv1 = "AES256-SHA"; |
103 | const char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA"; | 105 | const char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA"; |
104 | 106 | ||
107 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
105 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 108 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
106 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 109 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
107 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 110 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
108 | #endif | 111 | #endif |
112 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
109 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 113 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
110 | { | 114 | { |
111 | fprintf (stderr, "Error: %s\n", strerror (errno)); | 115 | fprintf (stderr, "Error: %s\n", strerror (errno)); |
diff --git a/src/testcurl/https/test_https_get_parallel.c b/src/testcurl/https/test_https_get_parallel.c index 45c08d0c..96529c43 100644 --- a/src/testcurl/https/test_https_get_parallel.c +++ b/src/testcurl/https/test_https_get_parallel.c | |||
@@ -31,7 +31,9 @@ | |||
31 | #include <limits.h> | 31 | #include <limits.h> |
32 | #include <curl/curl.h> | 32 | #include <curl/curl.h> |
33 | #include <pthread.h> | 33 | #include <pthread.h> |
34 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
34 | #include <gcrypt.h> | 35 | #include <gcrypt.h> |
36 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
35 | #include "tls_test_common.h" | 37 | #include "tls_test_common.h" |
36 | 38 | ||
37 | #if defined(CPU_COUNT) && (CPU_COUNT+0) < 4 | 39 | #if defined(CPU_COUNT) && (CPU_COUNT+0) < 4 |
diff --git a/src/testcurl/https/test_https_get_parallel_threads.c b/src/testcurl/https/test_https_get_parallel_threads.c index 03f31270..862b9512 100644 --- a/src/testcurl/https/test_https_get_parallel_threads.c +++ b/src/testcurl/https/test_https_get_parallel_threads.c | |||
@@ -33,7 +33,9 @@ | |||
33 | #include <limits.h> | 33 | #include <limits.h> |
34 | #include <curl/curl.h> | 34 | #include <curl/curl.h> |
35 | #include <pthread.h> | 35 | #include <pthread.h> |
36 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
36 | #include <gcrypt.h> | 37 | #include <gcrypt.h> |
38 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
37 | #include "tls_test_common.h" | 39 | #include "tls_test_common.h" |
38 | 40 | ||
39 | #if defined(CPU_COUNT) && (CPU_COUNT+0) < 4 | 41 | #if defined(CPU_COUNT) && (CPU_COUNT+0) < 4 |
@@ -140,9 +142,11 @@ main (int argc, char *const *argv) | |||
140 | /* initialize random seed used by curl clients */ | 142 | /* initialize random seed used by curl clients */ |
141 | unsigned int iseed = (unsigned int) time (NULL); | 143 | unsigned int iseed = (unsigned int) time (NULL); |
142 | 144 | ||
145 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
143 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 146 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
144 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 147 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
145 | #endif | 148 | #endif |
149 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
146 | srand (iseed); | 150 | srand (iseed); |
147 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 151 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
148 | { | 152 | { |
diff --git a/src/testcurl/https/test_https_get_select.c b/src/testcurl/https/test_https_get_select.c index 56bed223..d3191b8d 100644 --- a/src/testcurl/https/test_https_get_select.c +++ b/src/testcurl/https/test_https_get_select.c | |||
@@ -29,7 +29,9 @@ | |||
29 | #include <limits.h> | 29 | #include <limits.h> |
30 | #include <sys/stat.h> | 30 | #include <sys/stat.h> |
31 | #include <curl/curl.h> | 31 | #include <curl/curl.h> |
32 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
32 | #include <gcrypt.h> | 33 | #include <gcrypt.h> |
34 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
33 | #include "tls_test_common.h" | 35 | #include "tls_test_common.h" |
34 | 36 | ||
35 | extern const char srv_key_pem[]; | 37 | extern const char srv_key_pem[]; |
diff --git a/src/testcurl/https/test_https_multi_daemon.c b/src/testcurl/https/test_https_multi_daemon.c index fdd4b74e..99b1bfd4 100644 --- a/src/testcurl/https/test_https_multi_daemon.c +++ b/src/testcurl/https/test_https_multi_daemon.c | |||
@@ -29,7 +29,9 @@ | |||
29 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
30 | #include <limits.h> | 30 | #include <limits.h> |
31 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
32 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
32 | #include <gcrypt.h> | 33 | #include <gcrypt.h> |
34 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
33 | #include "tls_test_common.h" | 35 | #include "tls_test_common.h" |
34 | 36 | ||
35 | extern int curl_check_version (const char *req_version, ...); | 37 | extern int curl_check_version (const char *req_version, ...); |
@@ -98,10 +100,12 @@ main (int argc, char *const *argv) | |||
98 | FILE *cert; | 100 | FILE *cert; |
99 | const char *aes256_sha = "AES256-SHA"; | 101 | const char *aes256_sha = "AES256-SHA"; |
100 | 102 | ||
103 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
101 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 104 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
102 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 105 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
103 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 106 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
104 | #endif | 107 | #endif |
108 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
105 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 109 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
106 | { | 110 | { |
107 | fprintf (stderr, "Error (code: %u). l:%d f:%s\n", errorCount, __LINE__, | 111 | fprintf (stderr, "Error (code: %u). l:%d f:%s\n", errorCount, __LINE__, |
diff --git a/src/testcurl/https/test_https_session_info.c b/src/testcurl/https/test_https_session_info.c index d4f2985e..fe2d0724 100644 --- a/src/testcurl/https/test_https_session_info.c +++ b/src/testcurl/https/test_https_session_info.c | |||
@@ -27,7 +27,9 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "microhttpd.h" | 28 | #include "microhttpd.h" |
29 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
30 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
30 | #include <gcrypt.h> | 31 | #include <gcrypt.h> |
32 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
31 | #include "tls_test_common.h" | 33 | #include "tls_test_common.h" |
32 | 34 | ||
33 | extern int curl_check_version (const char *req_version, ...); | 35 | extern int curl_check_version (const char *req_version, ...); |
@@ -173,10 +175,12 @@ main (int argc, char *const *argv) | |||
173 | unsigned int errorCount = 0; | 175 | unsigned int errorCount = 0; |
174 | const char *ssl_version; | 176 | const char *ssl_version; |
175 | 177 | ||
178 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
176 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 179 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
177 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 180 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
178 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 181 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
179 | #endif | 182 | #endif |
183 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
180 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 184 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
181 | { | 185 | { |
182 | fprintf (stderr, "Error (code: %u)\n", errorCount); | 186 | fprintf (stderr, "Error (code: %u)\n", errorCount); |
diff --git a/src/testcurl/https/test_https_sni.c b/src/testcurl/https/test_https_sni.c index 6603cace..71805ba8 100644 --- a/src/testcurl/https/test_https_sni.c +++ b/src/testcurl/https/test_https_sni.c | |||
@@ -28,7 +28,9 @@ | |||
28 | #include <limits.h> | 28 | #include <limits.h> |
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <curl/curl.h> | 30 | #include <curl/curl.h> |
31 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
31 | #include <gcrypt.h> | 32 | #include <gcrypt.h> |
33 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
32 | #include "tls_test_common.h" | 34 | #include "tls_test_common.h" |
33 | #include <gnutls/gnutls.h> | 35 | #include <gnutls/gnutls.h> |
34 | 36 | ||
@@ -249,10 +251,12 @@ main (int argc, char *const *argv) | |||
249 | unsigned int error_count = 0; | 251 | unsigned int error_count = 0; |
250 | struct MHD_Daemon *d; | 252 | struct MHD_Daemon *d; |
251 | 253 | ||
254 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
252 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 255 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
253 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 256 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
254 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 257 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
255 | #endif | 258 | #endif |
259 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
256 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 260 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
257 | { | 261 | { |
258 | fprintf (stderr, "Error: %s\n", strerror (errno)); | 262 | fprintf (stderr, "Error: %s\n", strerror (errno)); |
diff --git a/src/testcurl/https/test_https_time_out.c b/src/testcurl/https/test_https_time_out.c index de619206..a1908e49 100644 --- a/src/testcurl/https/test_https_time_out.c +++ b/src/testcurl/https/test_https_time_out.c | |||
@@ -28,7 +28,9 @@ | |||
28 | #include "platform.h" | 28 | #include "platform.h" |
29 | #include "microhttpd.h" | 29 | #include "microhttpd.h" |
30 | #include "tls_test_common.h" | 30 | #include "tls_test_common.h" |
31 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
31 | #include <gcrypt.h> | 32 | #include <gcrypt.h> |
33 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
32 | #include "mhd_sockets.h" /* only macros used */ | 34 | #include "mhd_sockets.h" /* only macros used */ |
33 | 35 | ||
34 | 36 | ||
@@ -109,10 +111,12 @@ main (int argc, char *const *argv) | |||
109 | gnutls_certificate_credentials_t xcred; | 111 | gnutls_certificate_credentials_t xcred; |
110 | 112 | ||
111 | 113 | ||
114 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
112 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 115 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
113 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 116 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
114 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 117 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
115 | #endif | 118 | #endif |
119 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
116 | gnutls_global_init (); | 120 | gnutls_global_init (); |
117 | gnutls_global_set_log_level (11); | 121 | gnutls_global_set_log_level (11); |
118 | 122 | ||
diff --git a/src/testcurl/https/test_tls_authentication.c b/src/testcurl/https/test_tls_authentication.c index 9f337a32..20576a61 100644 --- a/src/testcurl/https/test_tls_authentication.c +++ b/src/testcurl/https/test_tls_authentication.c | |||
@@ -29,7 +29,9 @@ | |||
29 | #include <curl/curl.h> | 29 | #include <curl/curl.h> |
30 | #include <limits.h> | 30 | #include <limits.h> |
31 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
32 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
32 | #include <gcrypt.h> | 33 | #include <gcrypt.h> |
34 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
33 | #include "tls_test_common.h" | 35 | #include "tls_test_common.h" |
34 | 36 | ||
35 | extern int curl_check_version (const char *req_version, ...); | 37 | extern int curl_check_version (const char *req_version, ...); |
@@ -75,10 +77,12 @@ main (int argc, char *const *argv) | |||
75 | unsigned int errorCount = 0; | 77 | unsigned int errorCount = 0; |
76 | char *aes256_sha = "AES256-SHA"; | 78 | char *aes256_sha = "AES256-SHA"; |
77 | 79 | ||
80 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
78 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 81 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
79 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 82 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
80 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 83 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
81 | #endif | 84 | #endif |
85 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
82 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) | 86 | if (0 != curl_global_init (CURL_GLOBAL_ALL)) |
83 | { | 87 | { |
84 | fprintf (stderr, "Error (code: %u)\n", errorCount); | 88 | fprintf (stderr, "Error (code: %u)\n", errorCount); |
diff --git a/src/testcurl/https/test_tls_extensions.c b/src/testcurl/https/test_tls_extensions.c index ae680d17..69deb3a4 100644 --- a/src/testcurl/https/test_tls_extensions.c +++ b/src/testcurl/https/test_tls_extensions.c | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "microhttpd.h" | 29 | #include "microhttpd.h" |
30 | #include "tls_test_common.h" | 30 | #include "tls_test_common.h" |
31 | #include "mhd_sockets.h" /* only macros used */ | 31 | #include "mhd_sockets.h" /* only macros used */ |
32 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
33 | #include <gcrypt.h> | ||
34 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
32 | 35 | ||
33 | #define MAX_EXT_DATA_LENGTH 256 | 36 | #define MAX_EXT_DATA_LENGTH 256 |
34 | 37 | ||
@@ -213,10 +216,12 @@ main (int argc, char *const *argv) | |||
213 | -1 | 216 | -1 |
214 | }; | 217 | }; |
215 | 218 | ||
219 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
216 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 220 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
217 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 221 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
218 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 222 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
219 | #endif | 223 | #endif |
224 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
220 | MHD_gtls_global_set_log_level (11); | 225 | MHD_gtls_global_set_log_level (11); |
221 | 226 | ||
222 | if ((test_fd = setup_test_file ()) == NULL) | 227 | if ((test_fd = setup_test_file ()) == NULL) |
diff --git a/src/testcurl/https/test_tls_options.c b/src/testcurl/https/test_tls_options.c index ff8d1137..95f6b3ce 100644 --- a/src/testcurl/https/test_tls_options.c +++ b/src/testcurl/https/test_tls_options.c | |||
@@ -28,7 +28,9 @@ | |||
28 | #include "microhttpd.h" | 28 | #include "microhttpd.h" |
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <limits.h> | 30 | #include <limits.h> |
31 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
31 | #include <gcrypt.h> | 32 | #include <gcrypt.h> |
33 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
32 | #include "tls_test_common.h" | 34 | #include "tls_test_common.h" |
33 | 35 | ||
34 | extern const char srv_key_pem[]; | 36 | extern const char srv_key_pem[]; |
@@ -85,11 +87,13 @@ main (int argc, char *const *argv) | |||
85 | int daemon_flags = | 87 | int daemon_flags = |
86 | MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | MHD_USE_ERROR_LOG; | 88 | MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | MHD_USE_ERROR_LOG; |
87 | 89 | ||
90 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
88 | gcry_control (GCRYCTL_DISABLE_SECMEM, 0); | 91 | gcry_control (GCRYCTL_DISABLE_SECMEM, 0); |
89 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 92 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
90 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 93 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
91 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 94 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
92 | #endif | 95 | #endif |
96 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
93 | if (curl_check_version (MHD_REQ_CURL_VERSION)) | 97 | if (curl_check_version (MHD_REQ_CURL_VERSION)) |
94 | { | 98 | { |
95 | return 77; | 99 | return 77; |
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c index 3db08b4b..e22156db 100644 --- a/src/testcurl/test_digestauth.c +++ b/src/testcurl/test_digestauth.c | |||
@@ -31,9 +31,11 @@ | |||
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | #include <string.h> | 32 | #include <string.h> |
33 | #include <time.h> | 33 | #include <time.h> |
34 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
34 | #ifdef HAVE_GCRYPT_H | 35 | #ifdef HAVE_GCRYPT_H |
35 | #include <gcrypt.h> | 36 | #include <gcrypt.h> |
36 | #endif | 37 | #endif |
38 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
37 | 39 | ||
38 | #ifndef WINDOWS | 40 | #ifndef WINDOWS |
39 | #include <sys/socket.h> | 41 | #include <sys/socket.h> |
@@ -250,12 +252,14 @@ main (int argc, char *const *argv) | |||
250 | { | 252 | { |
251 | unsigned int errorCount = 0; | 253 | unsigned int errorCount = 0; |
252 | 254 | ||
255 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
253 | #ifdef HAVE_GCRYPT_H | 256 | #ifdef HAVE_GCRYPT_H |
254 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 257 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
255 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 258 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
256 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 259 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
257 | #endif | 260 | #endif |
258 | #endif | 261 | #endif |
262 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
259 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) | 263 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) |
260 | return 2; | 264 | return 2; |
261 | errorCount += testDigestAuth (); | 265 | errorCount += testDigestAuth (); |
diff --git a/src/testcurl/test_digestauth_with_arguments.c b/src/testcurl/test_digestauth_with_arguments.c index 3245b046..45228fa3 100644 --- a/src/testcurl/test_digestauth_with_arguments.c +++ b/src/testcurl/test_digestauth_with_arguments.c | |||
@@ -30,9 +30,11 @@ | |||
30 | #include <stdlib.h> | 30 | #include <stdlib.h> |
31 | #include <string.h> | 31 | #include <string.h> |
32 | #include <time.h> | 32 | #include <time.h> |
33 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
33 | #ifdef HAVE_GCRYPT_H | 34 | #ifdef HAVE_GCRYPT_H |
34 | #include <gcrypt.h> | 35 | #include <gcrypt.h> |
35 | #endif | 36 | #endif |
37 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
36 | 38 | ||
37 | #ifndef WINDOWS | 39 | #ifndef WINDOWS |
38 | #include <sys/socket.h> | 40 | #include <sys/socket.h> |
@@ -245,12 +247,14 @@ main (int argc, char *const *argv) | |||
245 | { | 247 | { |
246 | unsigned int errorCount = 0; | 248 | unsigned int errorCount = 0; |
247 | 249 | ||
250 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
248 | #ifdef HAVE_GCRYPT_H | 251 | #ifdef HAVE_GCRYPT_H |
249 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 252 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
250 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 253 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
251 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 254 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
252 | #endif | 255 | #endif |
253 | #endif | 256 | #endif |
257 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
254 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) | 258 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) |
255 | return 2; | 259 | return 2; |
256 | errorCount += testDigestAuth (); | 260 | errorCount += testDigestAuth (); |
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c index d7fd14a0..9e771da9 100644 --- a/src/testcurl/test_postform.c +++ b/src/testcurl/test_postform.c | |||
@@ -31,9 +31,11 @@ | |||
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | #include <string.h> | 32 | #include <string.h> |
33 | #include <time.h> | 33 | #include <time.h> |
34 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
34 | #ifdef HAVE_GCRYPT_H | 35 | #ifdef HAVE_GCRYPT_H |
35 | #include <gcrypt.h> | 36 | #include <gcrypt.h> |
36 | #endif | 37 | #endif |
38 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
37 | 39 | ||
38 | #ifndef WINDOWS | 40 | #ifndef WINDOWS |
39 | #include <unistd.h> | 41 | #include <unistd.h> |
@@ -564,12 +566,14 @@ main (int argc, char *const *argv) | |||
564 | { | 566 | { |
565 | unsigned int errorCount = 0; | 567 | unsigned int errorCount = 0; |
566 | 568 | ||
569 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | ||
567 | #ifdef HAVE_GCRYPT_H | 570 | #ifdef HAVE_GCRYPT_H |
568 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); | 571 | gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); |
569 | #ifdef GCRYCTL_INITIALIZATION_FINISHED | 572 | #ifdef GCRYCTL_INITIALIZATION_FINISHED |
570 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 573 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
571 | #endif | 574 | #endif |
572 | #endif | 575 | #endif |
576 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | ||
573 | oneone = (NULL != strrchr (argv[0], (int) '/')) ? | 577 | oneone = (NULL != strrchr (argv[0], (int) '/')) ? |
574 | (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; | 578 | (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; |
575 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) | 579 | if (0 != curl_global_init (CURL_GLOBAL_WIN32)) |