mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-29 04:09:31 +03:00
fully initialze modern gcrypt in MHD_init, only use thread initialization with legacy libgcrypt, update tests accordingly
This commit is contained in:
1 parent
902291420f
commit
c8ddb867ee
15 files changed
+9
-56
No files matched your search
@@ -183,16 +183,12 @@ testInternalSelectGet ()
|
||||
return 0;
|
||||
}
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
{
|
||||
unsigned int errorCount = 0;
|
||||
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
if (!gcry_check_version (GCRYPT_VERSION))
|
||||
abort ();
|
||||
if (0 != curl_global_init (CURL_GLOBAL_ALL))
|
||||
{
|
||||
fprintf (stderr, "Error: %s\n", strerror (errno));
|
||||
|
||||
@@ -95,9 +95,6 @@ test_secure_get (FILE * test_fd,
|
||||
}
|
||||
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
{
|
||||
@@ -106,11 +103,7 @@ main (int argc, char *const *argv)
|
||||
const char *aes256_sha_sslv3 = "AES256-SHA";
|
||||
const char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA";
|
||||
|
||||
|
||||
if (!gcry_check_version (GCRYPT_VERSION))
|
||||
abort ();
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
#ifdef GCRYCTL_INITIALIZATION_FINISHED
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
|
||||
@@ -121,7 +121,6 @@ test_parallel_clients (void * cls, const char *cipher_suite,
|
||||
return 0;
|
||||
}
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
@@ -132,7 +131,6 @@ main (int argc, char *const *argv)
|
||||
/* initialize random seed used by curl clients */
|
||||
unsigned int iseed = (unsigned int) time (NULL);
|
||||
srand (iseed);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
if (0 != curl_global_init (CURL_GLOBAL_ALL))
|
||||
{
|
||||
fprintf (stderr, "Error: %s\n", strerror (errno));
|
||||
|
||||
@@ -123,10 +123,6 @@ test_parallel_clients (void *cls, const char *cipher_suite,
|
||||
}
|
||||
|
||||
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
{
|
||||
@@ -136,9 +132,6 @@ main (int argc, char *const *argv)
|
||||
/* initialize random seed used by curl clients */
|
||||
unsigned int iseed = (unsigned int) time (NULL);
|
||||
|
||||
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
#ifdef GCRYCTL_INITIALIZATION_FINISHED
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
|
||||
@@ -206,16 +206,12 @@ testExternalGet (int flags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
{
|
||||
unsigned int errorCount = 0;
|
||||
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
if (!gcry_check_version (GCRYPT_VERSION))
|
||||
abort ();
|
||||
if (0 != curl_global_init (CURL_GLOBAL_ALL))
|
||||
{
|
||||
fprintf (stderr, "Error: %s\n", strerror (errno));
|
||||
|
||||
@@ -91,9 +91,6 @@ test_concurent_daemon_pair (void *cls,
|
||||
}
|
||||
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
{
|
||||
@@ -101,7 +98,6 @@ main (int argc, char *const *argv)
|
||||
FILE *cert;
|
||||
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
#ifdef GCRYCTL_INITIALIZATION_FINISHED
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
|
||||
@@ -151,16 +151,12 @@ test_query_session ()
|
||||
}
|
||||
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
{
|
||||
unsigned int errorCount = 0;
|
||||
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
#ifdef GCRYCTL_INITIALIZATION_FINISHED
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
|
||||
@@ -90,7 +90,6 @@ test_tls_session_time_out (gnutls_session_t session)
|
||||
return 0;
|
||||
}
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
@@ -104,7 +103,6 @@ main (int argc, char *const *argv)
|
||||
|
||||
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
#ifdef GCRYCTL_INITIALIZATION_FINISHED
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
|
||||
@@ -69,16 +69,12 @@ test_secure_get (void * cls, char *cipher_suite, int proto_version)
|
||||
}
|
||||
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
{
|
||||
unsigned int errorCount = 0;
|
||||
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
#ifdef GCRYCTL_INITIALIZATION_FINISHED
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
|
||||
@@ -193,7 +193,6 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL
|
||||
|
||||
int
|
||||
main (int argc, char *const *argv)
|
||||
@@ -206,13 +205,12 @@ main (int argc, char *const *argv)
|
||||
gnutls_datum_t cert;
|
||||
gnutls_certificate_credentials_t xcred;
|
||||
|
||||
int ext_arr[] = { GNUTLS_EXTENSION_SERVER_NAME,
|
||||
const int ext_arr[] = {
|
||||
GNUTLS_EXTENSION_SERVER_NAME,
|
||||
-1
|
||||
};
|
||||
|
||||
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
#ifdef GCRYCTL_INITIALIZATION_FINISHED
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
|
||||
@@ -75,7 +75,6 @@ test_unmatching_ssl_version (void * cls, const char *cipher_suite,
|
||||
return 0;
|
||||
}
|
||||
|
||||
GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||
|
||||
/* setup a temporary transfer test file */
|
||||
int
|
||||
@@ -83,12 +82,11 @@ main (int argc, char *const *argv)
|
||||
{
|
||||
unsigned int errorCount = 0;
|
||||
const char *ssl_version;
|
||||
|
||||
int daemon_flags =
|
||||
MHD_USE_THREAD_PER_CONNECTION | MHD_USE_SSL | MHD_USE_DEBUG;
|
||||
|
||||
gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
|
||||
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
|
||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||
#ifdef GCRYCTL_INITIALIZATION_FINISHED
|
||||
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user