gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated: Dropped dependency o


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated: Dropped dependency on libgcrypt with new GnuTLS (>2.12.20) versions
Date: Tue, 20 Jun 2017 22:55:47 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new a7b7a32e Dropped dependency on libgcrypt with new GnuTLS (>2.12.20) 
versions
a7b7a32e is described below

commit a7b7a32ec6dd493e00573da4b2f343f02feb0aa7
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Tue Jun 20 23:55:34 2017 +0300

    Dropped dependency on libgcrypt with new GnuTLS (>2.12.20) versions
---
 ChangeLog                                          |   3 +
 configure.ac                                       | 175 ++++++++++++++++-----
 src/examples/https_fileserver_example.c            |   2 +
 src/microhttpd/daemon.c                            |   7 +-
 src/testcurl/https/test_empty_response.c           |   2 +
 src/testcurl/https/test_https_get.c                |   4 +
 src/testcurl/https/test_https_get_parallel.c       |   2 +
 .../https/test_https_get_parallel_threads.c        |   4 +
 src/testcurl/https/test_https_get_select.c         |   2 +
 src/testcurl/https/test_https_multi_daemon.c       |   4 +
 src/testcurl/https/test_https_session_info.c       |   4 +
 src/testcurl/https/test_https_sni.c                |   4 +
 src/testcurl/https/test_https_time_out.c           |   4 +
 src/testcurl/https/test_tls_authentication.c       |   4 +
 src/testcurl/https/test_tls_extensions.c           |   5 +
 src/testcurl/https/test_tls_options.c              |   4 +
 src/testcurl/test_digestauth.c                     |   4 +
 src/testcurl/test_digestauth_with_arguments.c      |   4 +
 src/testcurl/test_postform.c                       |   4 +
 19 files changed, 198 insertions(+), 44 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3247c89d..178b7970 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+Tue Jun 20 23:52:00 MSK 2017
+       Libgcrypt is now optional and required only for old GnuTLS versions. -EG
+
 Wed Jun 14 21:42:00 MSK 2017
        Added support for debug assert() and new configure parameter 
        --enable-asserts for debug builds.
diff --git a/configure.ac b/configure.ac
index b8b10c62..c249aef1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1255,20 +1255,6 @@ then
 # Next block is large unindented block
 #
 
-# libgcrypt linkage: required for HTTPS support
-AM_PATH_LIBGCRYPT([1.2.2], [have_gcrypt=yes], [have_gcrypt=no])
-if test "x$have_gcrypt" = "xyes"
-then
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
-  # LIBGCRYPT_CFLAGS can be actually a CPPFLAGS, so check them both
-  SAVE_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $LIBGCRYPT_CFLAGS"
-  AC_CHECK_HEADERS([gcrypt.h], [], [have_gcrypt=no], [AC_INCLUDES_DEFAULT])
-  CFLAGS="$SAVE_CFLAGS"
-  CPPFLAGS="$SAVE_CPPFLAGS"
-fi
-
 # gnutls
 have_gnutls_pkgcfg=no
 AC_MSG_CHECKING([[how to find GnuTLS library]])
@@ -1358,16 +1344,33 @@ AS_IF([test "x$with_gnutls" != "xno" && test 
"x$have_gnutls" != "xyes"],
        LIBS="$SAVE_LIBS"
       ],
       [
+       # check for GnuTLS at default paths
        have_gnutls_pkgcfg='no'
+       AC_CHECK_HEADERS([gnutls/gnutls.h],
+        [AC_CHECK_LIB([gnutls], [gnutls_priority_set],
+          [
+            GNUTLS_LIBS="-lgnutls"
+            AC_CHECK_LIB([gnutls], [gnutls_load_file], [AC_CHECK_LIB([gnutls], 
[gnutls_privkey_import_x509_raw], [have_gnutls_sni=yes])])
+            have_gnutls=yes
+          ])], [], [AC_INCLUDES_DEFAULT])
+      ])
+  ])
+
+have_gcrypt='unknown'
+AS_IF([test "x$with_gnutls" != "xno" && test "x$have_gnutls" != "xyes"],
+  [
+   AM_PATH_LIBGCRYPT([1.2.2], [have_gcrypt=yes], [have_gcrypt=no])
+   AS_IF([[test "x$have_gcrypt" = "xyes"]],
+     [
        SAVE_CPPFLAGS="$CPPFLAGS"
        SAVE_CFLAGS="$CFLAGS"
-       SAVE_LDFLAGS="$LDFLAGS"
        SAVE_LIBS="$LIBS"
-       # Try to use libgcrypt search path
-       # as libgcrypt flags will be used
-       # anyway for HTTPs builds
+       SAVE_LDFLAGS="$LDFLAGS"
        CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+       # LIBGCRYPT_CFLAGS can be actually a CPPFLAGS, so check them both
        CPPFLAGS="$CPPFLAGS $LIBGCRYPT_CFLAGS"
+       AC_CHECK_HEADERS([gcrypt.h], [], [have_gcrypt=no], 
[AC_INCLUDES_DEFAULT])
+       # Check for GnuTLS with gcrypt flags
        LDFLAGS="$LDFLAGS $LIBGCRYPT_LIBS"
        AC_CHECK_HEADERS([gnutls/gnutls.h],
         [AC_CHECK_LIB([gnutls], [gnutls_priority_set],
@@ -1383,44 +1386,129 @@ AS_IF([test "x$with_gnutls" != "xno" && test 
"x$have_gnutls" != "xyes"],
        CFLAGS="$SAVE_CFLAGS"
        LDFLAGS="$SAVE_LDFLAGS"
        LIBS="$SAVE_LIBS"
-      ])
-  ])
-
+     ]
+   )
+  ]
+)
 AS_IF([test "x$have_gnutls" != "xyes" && test "x$with_gnutls" = "xyes"], 
[AC_MSG_ERROR([[can't find usable libgnutls]])])
-
-AC_SUBST([GNUTLS_CPPFLAGS])
-AC_SUBST([GNUTLS_CFLAGS])
-AC_SUBST([GNUTLS_LDFLAGS])
-AC_SUBST([GNUTLS_LIBS])
-
 #
 # End of large unindented block
 #
-  AS_IF([test "x$have_gnutls" = "xyes" && test "x$have_gcrypt" = "xyes"], [
+
+  AS_IF([test "x$have_gnutls" = "xyes"],
+    [
+     SAVE_CPPFLAGS="$CPPFLAGS"
+     SAVE_CFLAGS="$CFLAGS"
+     SAVE_LDFLAGS="$LDFLAGS"
+     SAVE_LIBS="$LIBS"
+     CPPFLAGS="$GNUTLS_CFLAGS $CPPFLAGS"
+     CFLAGS="$GNUTLS_CFLAGS $CFLAGS"
+     LDFLAGS="$GNUTLS_LIBS $LDFLAGS"
+     LIBS="$LIBS $GNUTLS_LIBS"
+     AC_CACHE_CHECK([[whether GnuTLS require libgcrypt initialisaion]], 
[mhd_cv_grypt_required],
+       [
+        AC_COMPILE_IFELSE(
+          [
+           AC_LANG_PROGRAM(
+             [
+#include <gnutls/gnutls.h>
+             ],
+             [
+#if !defined(GNUTLS_VERSION_NUMBER) || GNUTLS_VERSION_NUMBER+0 <= 0x020c14
+#error Old versions of GnuTLS require libgcript initialisaion
+choke me now
+#endif
+             ]
+           )
+          ],
+          [[mhd_cv_grypt_required='no']], [[mhd_cv_grypt_required='yes']]
+        )
+       ]
+     )
+     CPPFLAGS="$SAVE_CPPFLAGS"
+     CFLAGS="$SAVE_CFLAGS"
+     LDFLAGS="$SAVE_LDFLAGS"
+     LIBS="$SAVE_LIBS"
+    ]
+  )
+
+  AS_IF([[test "x$mhd_cv_grypt_required" = "xyes" && test "x$have_gcrypt" = 
"xunknown"]],
+    [
+     AM_PATH_LIBGCRYPT([1.2.2], [have_gcrypt=yes], [have_gcrypt=no])
+     AS_IF([[test "x$have_gcrypt" = "xyes"]],
+       [
+         SAVE_CPPFLAGS="$CPPFLAGS"
+         SAVE_CFLAGS="$CFLAGS"
+         CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+         # LIBGCRYPT_CFLAGS can be actually a CPPFLAGS, so check them both
+         CPPFLAGS="$CPPFLAGS $LIBGCRYPT_CFLAGS"
+         AC_CHECK_HEADERS([gcrypt.h], [], [have_gcrypt=no], 
[AC_INCLUDES_DEFAULT])
+         # Check for GnuTLS with gcrypt flags
+         CPPFLAGS="$SAVE_CPPFLAGS"
+         CFLAGS="$SAVE_CFLAGS"
+       ]
+     )
+    ]
+  )
+  AC_SUBST([GNUTLS_CPPFLAGS])
+  AC_SUBST([GNUTLS_CFLAGS])
+  AC_SUBST([GNUTLS_LDFLAGS])
+  AC_SUBST([GNUTLS_LIBS])
+
+  AS_UNSET([[crypt_missing]])
+  AS_IF([[test "x$have_gnutls" = "xyes"]],
+    [
+     AS_IF([[test "x$mhd_cv_grypt_required" = "xyes" && test "x$have_gcrypt" 
!= "xyes"]],
+       [
+        crypt_missing="required libgcrypt"
+        AS_IF([[test "x$enable_https" = "xyes" ]], [AC_MSG_ERROR([[HTTPS 
support cannot be enabled without $crypt_missing.]])])
+        enable_https=no
+        MSG_HTTPS="no (lacking $crypt_missing)"
+       ],
+         [
           AC_DEFINE([[HTTPS_SUPPORT]],[[1]],[Define to 1 if libmicrohttpd is 
compiled with HTTPS support.])
           enable_https=yes
-          MSG_HTTPS="yes (using libgnutls and libgcrypt)"
-          MHD_LIB_CPPFLAGS="$MHD_LIB_CPPFLAGS $LIBGCRYPT_CFLAGS 
$GNUTLS_CPPFLAGS"
-          MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $LIBGCRYPT_CFLAGS $GNUTLS_CFLAGS"
-          MHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS $GNUTLS_LDFLAGS"
-          MHD_LIBDEPS="$GNUTLS_LIBS $LIBGCRYPT_LIBS $MHD_LIBDEPS"
+          AS_IF([[test "x$mhd_cv_grypt_required" = "xyes"]],
+            [
+             MSG_HTTPS="yes (using libgnutls and libgcrypt)"
+             MHD_LIB_CPPFLAGS="$MHD_LIB_CPPFLAGS $LIBGCRYPT_CFLAGS 
$GNUTLS_CPPFLAGS"
+             MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $LIBGCRYPT_CFLAGS $GNUTLS_CFLAGS"
+             MHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS $GNUTLS_LDFLAGS"
+             MHD_LIBDEPS="$GNUTLS_LIBS $LIBGCRYPT_LIBS $MHD_LIBDEPS"
+             AC_DEFINE([[MHD_HTTPS_REQUIRE_GRYPT]], [[1]], [Define to `1' if 
HTTPS require initialisation of libgcrypt])
+            ],
+            [[
+             MSG_HTTPS="yes (using libgnutls)"
+             MHD_LIB_CPPFLAGS="$MHD_LIB_CPPFLAGS $GNUTLS_CPPFLAGS"
+             MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $GNUTLS_CFLAGS"
+             MHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS $GNUTLS_LDFLAGS"
+             MHD_LIBDEPS="$GNUTLS_LIBS $MHD_LIBDEPS"
+            ]]
+          )
           AS_IF([[ test "x$have_gnutls_pkgcfg" = "xyes" ]],
             [ # remove GnuTLS from private libs in .pc file as it defined in 
Requires.private
               MHD_REQ_PRIVATE='gnutls'
-              MHD_LIBDEPS_PKGCFG="$LIBGCRYPT_LIBS $MHD_LIBDEPS_PKGCFG"
+              AS_IF([[test "x$mhd_cv_grypt_required" = "xyes"]],
+                [[MHD_LIBDEPS_PKGCFG="$LIBGCRYPT_LIBS $MHD_LIBDEPS_PKGCFG"]]
+              )
             ],
             [
               MHD_REQ_PRIVATE=''
-              MHD_LIBDEPS_PKGCFG="$GNUTLS_LIBS $LIBGCRYPT_LIBS 
$MHD_LIBDEPS_PKGCFG"
+              AS_IF([[test "x$mhd_cv_grypt_required" = "xyes"]],
+                [[MHD_LIBDEPS_PKGCFG="$LIBGCRYPT_LIBS $MHD_LIBDEPS_PKGCFG"]]
+              )
+              MHD_LIBDEPS_PKGCFG="$GNUTLS_LIBS $MHD_LIBDEPS_PKGCFG"
           ])
-        ], [
-          AS_IF([test "x$have_gnutls" = "xyes"], [crypt_missing="libgcrypt"],
-                [test "x$have_gcrypt" = "xyes"], [crypt_missing="libgnutls"],
-                                                 [crypt_missing="libgcrypt and 
libgnutls"])
-          AS_IF([[test "x$enable_https" = "xyes" ]], [AC_MSG_ERROR([[HTTPS 
support cannot be enabled without $crypt_missing.]])])
-          enable_https=no
-          MSG_HTTPS="no (lacking $crypt_missing)"
-        ])
+         ]
+     )
+    ],
+    [
+     crypt_missing="libgnutls"
+     AS_IF([[test "x$enable_https" = "xyes" ]], [AC_MSG_ERROR([[HTTPS support 
cannot be enabled without $crypt_missing.]])])
+     enable_https=no
+     MSG_HTTPS="no (lacking $crypt_missing)"
+    ]
+  )
 else
   MSG_HTTPS="no (disabled)"
 fi
@@ -1430,6 +1518,7 @@ AC_MSG_RESULT([$MSG_HTTPS])
 AM_CONDITIONAL([HAVE_GNUTLS], [[test "x$have_gnutls" = "xyes"]])
 AM_CONDITIONAL([HAVE_GNUTLS_SNI], [[test "x$have_gnutls_sni" = "xyes"]])
 AM_CONDITIONAL([ENABLE_HTTPS], [test "x$enable_https" = "xyes"])
+AM_CONDITIONAL([HTTPS_REQUIRE_GRYPT], [[test "x$enable_https" = "xyes" && test 
"x$mhd_cv_grypt_required" = "xyes"]])
 
 # optional: HTTP Basic Auth support. Enabled by default
 AC_MSG_CHECKING([[whether to support HTTP basic authentication]])
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 @@
 #include <microhttpd.h>
 #include <sys/stat.h>
 #include <gnutls/gnutls.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif
 
 #define BUF_SIZE 1024
 #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 @@
 
 #ifdef HTTPS_SUPPORT
 #include "connection_https.h"
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #endif /* HTTPS_SUPPORT */
 
 #ifdef _WIN32
@@ -6520,6 +6522,7 @@ MHD_is_feature_supported(enum MHD_FEATURE feature)
 }
 
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #if defined(HTTPS_SUPPORT) && GCRYPT_VERSION_NUMBER < 0x010600
 #if defined(MHD_USE_POSIX_THREADS)
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
@@ -6574,7 +6577,7 @@ static struct gcry_thread_cbs gcry_threads_w32 = {
 
 #endif /* defined(MHD_W32_MUTEX_) */
 #endif /* HTTPS_SUPPORT && GCRYPT_VERSION_NUMBER < 0x010600 */
-
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 
 /**
  * Initialize do setup work.
@@ -6596,6 +6599,7 @@ MHD_init(void)
     MHD_PANIC (_("Winsock version 2.2 is not available\n"));
 #endif
 #ifdef HTTPS_SUPPORT
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #if GCRYPT_VERSION_NUMBER < 0x010600
 #if defined(MHD_USE_POSIX_THREADS)
   if (0 != gcry_control (GCRYCTL_SET_THREAD_CBS,
@@ -6611,6 +6615,7 @@ MHD_init(void)
   if (NULL == gcry_check_version ("1.6.0"))
     MHD_PANIC (_("libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 
or newer\n"));
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   gnutls_global_init ();
 #endif /* HTTPS_SUPPORT */
   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 @@
 #include <limits.h>
 #include <sys/stat.h>
 #include <curl/curl.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 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 @@
 #include <limits.h>
 #include <sys/stat.h>
 #include <curl/curl.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 extern const char srv_key_pem[];
@@ -102,10 +104,12 @@ main (int argc, char *const *argv)
   const char *aes256_sha_tlsv1   = "AES256-SHA";
   const char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA";
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   if (0 != curl_global_init (CURL_GLOBAL_ALL))
     {
       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 @@
 #include <limits.h>
 #include <curl/curl.h>
 #include <pthread.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 #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 @@
 #include <limits.h>
 #include <curl/curl.h>
 #include <pthread.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 #if defined(CPU_COUNT) && (CPU_COUNT+0) < 4
@@ -140,9 +142,11 @@ main (int argc, char *const *argv)
   /* initialize random seed used by curl clients */
   unsigned int iseed = (unsigned int) time (NULL);
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   srand (iseed);
   if (0 != curl_global_init (CURL_GLOBAL_ALL))
     {
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 @@
 #include <limits.h>
 #include <sys/stat.h>
 #include <curl/curl.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 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 @@
 #include <curl/curl.h>
 #include <limits.h>
 #include <sys/stat.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 extern int curl_check_version (const char *req_version, ...);
@@ -98,10 +100,12 @@ main (int argc, char *const *argv)
   FILE *cert;
   const char *aes256_sha = "AES256-SHA";
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   if (0 != curl_global_init (CURL_GLOBAL_ALL))
     {
       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 @@
 #include "platform.h"
 #include "microhttpd.h"
 #include <curl/curl.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 extern int curl_check_version (const char *req_version, ...);
@@ -173,10 +175,12 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   const char *ssl_version;
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   if (0 != curl_global_init (CURL_GLOBAL_ALL))
     {
       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 @@
 #include <limits.h>
 #include <sys/stat.h>
 #include <curl/curl.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 #include <gnutls/gnutls.h>
 
@@ -249,10 +251,12 @@ main (int argc, char *const *argv)
   unsigned int error_count = 0;
   struct MHD_Daemon *d;
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   if (0 != curl_global_init (CURL_GLOBAL_ALL))
     {
       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 @@
 #include "platform.h"
 #include "microhttpd.h"
 #include "tls_test_common.h"
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "mhd_sockets.h" /* only macros used */
 
 
@@ -109,10 +111,12 @@ main (int argc, char *const *argv)
   gnutls_certificate_credentials_t xcred;
 
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   gnutls_global_init ();
   gnutls_global_set_log_level (11);
 
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 @@
 #include <curl/curl.h>
 #include <limits.h>
 #include <sys/stat.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 extern int curl_check_version (const char *req_version, ...);
@@ -75,10 +77,12 @@ main (int argc, char *const *argv)
   unsigned int errorCount = 0;
   char *aes256_sha = "AES256-SHA";
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   if (0 != curl_global_init (CURL_GLOBAL_ALL))
     {
       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 @@
 #include "microhttpd.h"
 #include "tls_test_common.h"
 #include "mhd_sockets.h" /* only macros used */
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
+#include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 
 #define MAX_EXT_DATA_LENGTH 256
 
@@ -213,10 +216,12 @@ main (int argc, char *const *argv)
     -1
   };
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   MHD_gtls_global_set_log_level (11);
 
   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 @@
 #include "microhttpd.h"
 #include <sys/stat.h>
 #include <limits.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #include <gcrypt.h>
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 #include "tls_test_common.h"
 
 extern const char srv_key_pem[];
@@ -85,11 +87,13 @@ main (int argc, char *const *argv)
   int daemon_flags =
     MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_TLS | MHD_USE_ERROR_LOG;
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
   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 */
  if (curl_check_version (MHD_REQ_CURL_VERSION))
     {
       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 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
 #include <gcrypt.h>
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 
 #ifndef WINDOWS
 #include <sys/socket.h>
@@ -250,12 +252,14 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   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 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
 #include <gcrypt.h>
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 
 #ifndef WINDOWS
 #include <sys/socket.h>
@@ -245,12 +247,14 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))
     return 2;
   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 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
 #include <gcrypt.h>
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
 
 #ifndef WINDOWS
 #include <unistd.h>
@@ -564,12 +566,14 @@ main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
 
+#ifdef MHD_HTTPS_REQUIRE_GRYPT
 #ifdef HAVE_GCRYPT_H
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
 #ifdef GCRYCTL_INITIALIZATION_FINISHED
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 #endif
 #endif
+#endif /* MHD_HTTPS_REQUIRE_GRYPT */
   oneone = (NULL != strrchr (argv[0], (int) '/')) ?
     (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
   if (0 != curl_global_init (CURL_GLOBAL_WIN32))

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]