Fixed initialisation of old GnuTLS versions

This commit is contained in:
Evgeny Grin (Karlson2k) committed 2022-09-25 18:39:40 +03:00
1 parent 8815effe66
commit 1e288041bd
21 files changed
+84 -82

No files matched your search

+2 -2
View File
@@ -28,9 +28,9 @@
#include <limits.h>
#include <sys/stat.h>
#include <curl/curl.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
+4 -4
View File
@@ -29,9 +29,9 @@
#include <limits.h>
#include <sys/stat.h>
#include <curl/curl.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
@@ -234,12 +234,12 @@ main (int argc, char *const *argv)
const char *aes256_sha_tlsv1 = "AES256-SHA";
(void) argc; (void) argv; /* Unused. Silent compiler warning. */
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
if (! testsuite_curl_global_init ())
return 99;
if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
+4 -4
View File
@@ -37,9 +37,9 @@
#include <limits.h>
#include <sys/stat.h>
#include <curl/curl.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
@@ -391,12 +391,12 @@ main (int argc, char *const *argv)
const char *aes256_sha_tlsv1 = "AES256-SHA";
(void) argc; (void) argv; /* Unused. Silent compiler warning. */
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
if (! testsuite_curl_global_init ())
return 99;
if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
+2 -2
View File
@@ -31,9 +31,9 @@
#include <limits.h>
#include <curl/curl.h>
#include <pthread.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
@@ -33,9 +33,9 @@
#include <limits.h>
#include <curl/curl.h>
#include <pthread.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
@@ -152,11 +152,11 @@ main (int argc, char *const *argv)
/* initialize random seed used by curl clients */
iseed = (unsigned int) time (NULL);
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
srand (iseed);
if (! testsuite_curl_global_init ())
return 99;
+2 -2
View File
@@ -29,9 +29,9 @@
#include <limits.h>
#include <sys/stat.h>
#include <curl/curl.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
+4 -4
View File
@@ -29,9 +29,9 @@
#include <curl/curl.h>
#include <limits.h>
#include <sys/stat.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
@@ -132,12 +132,12 @@ main (int argc, char *const *argv)
const char *aes256_sha = "AES256-SHA";
(void) argc; (void) argv; /* Unused. Silent compiler warning. */
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
if (! testsuite_curl_global_init ())
return 99;
if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
+4 -4
View File
@@ -29,9 +29,9 @@
#include "platform.h"
#include "microhttpd.h"
#include <curl/curl.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
@@ -200,12 +200,12 @@ main (int argc, char *const *argv)
const char *ssl_version;
(void) argc; /* Unused. Silent compiler warning. */
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
if (! testsuite_curl_global_init ())
return 99;
+4 -4
View File
@@ -28,9 +28,9 @@
#include <limits.h>
#include <sys/stat.h>
#include <curl/curl.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include <gnutls/gnutls.h>
@@ -264,12 +264,12 @@ main (int argc, char *const *argv)
else
port = 3060;
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
if (! testsuite_curl_global_init ())
return 99;
tls_backend = curl_version_info (CURLVERSION_NOW)->ssl_version;
+4 -4
View File
@@ -30,9 +30,9 @@
#include "platform.h"
#include "microhttpd.h"
#include "tls_test_common.h"
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif /* HAVE_SIGNAL_H */
@@ -208,12 +208,12 @@ main (int argc, char *const *argv)
#endif
#endif /* MHD_SEND_SPIPE_SUPPRESS_NEEDED */
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
if (GNUTLS_E_SUCCESS != gnutls_global_init ())
{
fprintf (stderr, "Cannot initialize GnuTLS.\n");
+4 -4
View File
@@ -29,9 +29,9 @@
#include <curl/curl.h>
#include <limits.h>
#include <sys/stat.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
@@ -90,12 +90,12 @@ main (int argc, char *const *argv)
(void) argc;
(void) argv; /* Unused. Silent compiler warning. */
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
if (! testsuite_curl_global_init ())
return 99;
if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
+4 -4
View File
@@ -29,9 +29,9 @@
#include "microhttpd.h"
#include "tls_test_common.h"
#include "mhd_sockets.h" /* only macros used */
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_keys.h"
#define MAX_EXT_DATA_LENGTH 256
@@ -220,12 +220,12 @@ main (int argc, char *const *argv)
else
port = 3080;
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
MHD_gtls_global_set_log_level (11);
if ((test_fd = setup_test_file ()) == NULL)
+4 -4
View File
@@ -28,9 +28,9 @@
#include "microhttpd.h"
#include <sys/stat.h>
#include <limits.h>
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
#include <gcrypt.h>
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
#include "tls_test_common.h"
#include "tls_test_keys.h"
@@ -100,13 +100,13 @@ main (int argc, char *const *argv)
else
port = 3010;
#ifdef MHD_HTTPS_REQUIRE_GRYPT
#ifdef MHD_HTTPS_REQUIRE_GCRYPT
gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
#endif /* MHD_HTTPS_REQUIRE_GRYPT */
#endif /* MHD_HTTPS_REQUIRE_GCRYPT */
if (! testsuite_curl_global_init ())
return 99;