mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
Dropped dependency on libgcrypt with new GnuTLS (>2.12.20) versions
This commit is contained in:
@@ -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.
|
||||
|
||||
+132
-43
@@ -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]])
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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__,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user