libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit f56131958544cff00fac1e2a777df5e08535649a
parent 04c37e5bd7a82f60127b64338cf37c470ca93e12
Author: lv-426 <oxcafebaby@yahoo.com>
Date:   Sun, 20 Jul 2008 04:38:41 +0000

configure.ac: libgcrypt required for HTTPS support
some makefile issues
all cURL tests set to use SSLv3 [temporary]

Diffstat:
Mconfigure.ac | 45++++++++++++++++++++++++++-------------------
Msrc/daemon/Makefile.am | 1+
Msrc/daemon/connection_https.c | 6++----
Msrc/daemon/https/tls/Makefile.am | 1+
Msrc/daemon/https/x509/pkcs12.h | 6+++---
Msrc/daemon/https/x509/x509.h | 1-
Msrc/daemon/internal.h | 1-
Msrc/testcurl/https/Makefile.am | 2+-
Msrc/testcurl/https/mhds_get_test.c | 14++++++--------
Msrc/testcurl/https/mhds_multi_daemon_test.c | 1-
Msrc/testcurl/https/tls_authentication_test.c | 1-
11 files changed, 40 insertions(+), 39 deletions(-)

diff --git a/configure.ac b/configure.ac @@ -207,30 +207,17 @@ fi AM_CONDITIONAL(ENABLE_OPENPGP, test "$enable_openpgp" = "yes") -# Symbols required by GNU_TLS -AC_DEFINE([ENABLE_MINITASN1],[1],[Include minitasn1 support]) -AC_DEFINE([GNULIB_GC_HMAC_SHA1],[1],[GNULIB_GC_HMAC_SHA1]) -AC_DEFINE([GNULIB_GC_RANDOM],[1],[GNULIB_GC_RANDOM]) -AC_DEFINE([ENABLE_PKI],[1],[Include ENABLE_OPENPGP support]) -AC_DEFINE([ENABLE_INCLUDED_OPENCDK],[1],[Include ENABLE_INCLUDED_OPENCDK support]) -# gnutls debug support -AC_DEFINE([DEBUG],[1],[Include gnutls debug message support]) -AC_DEFINE([C99_MACROS],[1],[Include gnutls debug message support]) - -AC_DEFINE([ENABLE_OPENSSL],[0],[Include ENABLE_OPENSSL support]) -AC_DEFINE([HAVE_LD_OUTPUT_DEF],[0],[Include HAVE_LD_OUTPUT_DEF support]) -AC_DEFINE([HAVE_LD_VERSION_SCRIPT],[0],[Include HAVE_LD_VERSION_SCRIPT support]) - -# Libgcrypt linkage +# Libgcrypt linkage : required for HTTPS support +AC_CHECK_HEADERS(gcrypt.h,gcrypt=true,gcrypt=false) AC_ARG_WITH(libgcrypt, [AS_HELP_STRING([--with-libgcrypt=PFX], [Base of libgcrypt installation])], [AC_MSG_RESULT("$with_libgcrypt") case $with_libgcrypt in no) + gcrypt=false ;; yes) - AC_CHECK_HEADERS(gcrypt.h,gcrypt=true) ;; *) LDFLAGS="-L$with_libgcrypt/lib $LDFLAGS" @@ -241,7 +228,8 @@ AC_ARG_WITH(libgcrypt, GCRYPT_LIB_PATH="$with_libgcrypt/lib" GCRYPT_LDFLAGS="-L$with_libgcrypt/lib" GCRYPT_CPPFLAGS="-I$with_libgcrypt/include" - libgcrypt=true)) + gcrypt=true, + gcrypt=false)) LDFLAGS=$SAVE_LDFLAGS CPPFLAGS=$SAVE_CPPFLAGS ;; @@ -257,6 +245,21 @@ AC_SUBST(GCRYPT_LIB_PATH) AC_SUBST(GCRYPT_LDFLAGS) AC_SUBST(GCRYPT_CPPFLAGS) +# Symbols required by GNU_TLS +AC_DEFINE([ENABLE_MINITASN1],[1],[Include minitasn1 support]) +AC_DEFINE([GNULIB_GC_HMAC_SHA1],[1],[GNULIB_GC_HMAC_SHA1]) +AC_DEFINE([GNULIB_GC_RANDOM],[1],[GNULIB_GC_RANDOM]) +AC_DEFINE([ENABLE_PKI],[1],[Include ENABLE_OPENPGP support]) +AC_DEFINE([ENABLE_INCLUDED_OPENCDK],[1],[Include ENABLE_INCLUDED_OPENCDK support]) +# gnutls debug support +AC_DEFINE([DEBUG],[1],[Include gnutls debug message support]) +AC_DEFINE([C99_MACROS],[1],[Include gnutls debug message support]) + +AC_DEFINE([ENABLE_OPENSSL],[0],[Include ENABLE_OPENSSL support]) +AC_DEFINE([HAVE_LD_OUTPUT_DEF],[0],[Include HAVE_LD_OUTPUT_DEF support]) +AC_DEFINE([HAVE_LD_VERSION_SCRIPT],[0],[Include HAVE_LD_VERSION_SCRIPT support]) + + AC_SUBST(CPPFLAGS) AC_SUBST(LIBS) AC_SUBST(LDFLAGS) @@ -293,4 +296,9 @@ AM_CONDITIONAL(ENABLE_INCLUDED_OPENCDK, [test -n "" ] ) if test "$curl" != 1 then AC_MSG_NOTICE([WARNING: libcurl not found, testcases cannot be built.]) -fi -\ No newline at end of file +fi +if test "$gcrypt" != true +then + AC_MSG_NOTICE([WARNING: libgcrypt not found, HTTPS supprot cannot be built.]) +fi + diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am @@ -3,6 +3,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/daemon \ -I$(top_srcdir)/src/daemon/https/lgl \ -I$(top_srcdir)/src/daemon/https/x509 \ +-I$(top_srcdir)/src/daemon/https/minitasn1 \ -I$(top_srcdir)/src/daemon/https/openpgp \ -I$(top_srcdir)/src/daemon/https/opencdk \ -I$(top_srcdir)/src/daemon/https/tls \ diff --git a/src/daemon/connection_https.c b/src/daemon/connection_https.c @@ -37,7 +37,7 @@ #include "gnutls_int.h" #include "gnutls_record.h" -/* TODO rm */ +/* TODO rm #include "gnutls_errors.h" */ #include "gnutls_errors.h" /* forward declarations used when setting secure connection callbacks */ @@ -45,7 +45,6 @@ int MHD_connection_handle_read (struct MHD_Connection *connection); int MHD_connection_handle_write (struct MHD_Connection *connection); int MHD_connection_handle_idle (struct MHD_Connection *connection); -/* TODO rm - appears in a switch default clause */ static void MHD_tls_connection_close (struct MHD_Connection *connection) { @@ -63,11 +62,10 @@ MHD_tls_connection_close (struct MHD_Connection *connection) MHD_REQUEST_TERMINATED_COMPLETED_OK); } -/* TODO add error connection termination */ static void MHD_tls_connection_close_err (struct MHD_Connection *connection) { - /* TODO impl */ + /* TODO impl MHD_tls_connection_close_err */ } union MHD_SessionInfo diff --git a/src/daemon/https/tls/Makefile.am b/src/daemon/https/tls/Makefile.am @@ -6,6 +6,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/daemon/https \ -I$(top_srcdir)/src/daemon/https/tls \ -I$(top_srcdir)/src/daemon/https/lgl \ +-I$(top_srcdir)/src/daemon/https/minitasn1 \ -I$(top_srcdir)/src/daemon/https/x509 \ -I$(top_srcdir)/src/daemon/https/openpgp \ -I$(top_srcdir)/src/daemon/https/opencdk \ diff --git a/src/daemon/https/x509/pkcs12.h b/src/daemon/https/x509/pkcs12.h @@ -22,10 +22,10 @@ * */ -// TODO clean +/* TODO clean */ #ifndef GNUTLS_PKCS12_H -# define GNUTLS_PKCS12_H +#define GNUTLS_PKCS12_H #ifdef __cplusplus extern "C" @@ -36,7 +36,7 @@ extern "C" #define MAX_BAG_ELEMENTS 32 -/* PKCS12 structures handling +/* PKCS12 structures handling */ struct gnutls_pkcs12_int; diff --git a/src/daemon/https/x509/x509.h b/src/daemon/https/x509/x509.h @@ -33,7 +33,6 @@ extern "C" #endif #include <gnutls.h> -// TODO #include "libtasn1.h" #include "gnutls_mpi.h" /* Some OIDs usually found in Distinguished names, or diff --git a/src/daemon/internal.h b/src/daemon/internal.h @@ -530,7 +530,6 @@ struct MHD_Connection unsigned int current_chunk_offset; /* handlers used for processing read, write & idle connection operations */ - /* TODO fix sig */ int (*read_handler) (struct MHD_Connection * connection); int (*write_handler) (struct MHD_Connection * connection); diff --git a/src/testcurl/https/Makefile.am b/src/testcurl/https/Makefile.am @@ -13,7 +13,7 @@ check_PROGRAMS = \ mhds_get_test \ tls_authentication_test \ mhds_multi_daemon_test \ - mhds_session_info_test + mhds_session_info_test TESTS = $(check_PROGRAMS) diff --git a/src/testcurl/https/mhds_get_test.c b/src/testcurl/https/mhds_get_test.c @@ -90,7 +90,6 @@ http_ahc (void *cls, struct MHD_Connection *connection, FILE *file; struct stat buf; - // TODO never respond on first call if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) return MHD_NO; /* unexpected method */ if (&aptr != *ptr) @@ -178,7 +177,7 @@ test_daemon_get (FILE * test_fd, char *cipher_suite, int proto_version) c = curl_easy_init (); #ifdef DEBUG - //curl_easy_setopt (c, CURLOPT_VERBOSE, 1); + curl_easy_setopt (c, CURLOPT_VERBOSE, 1); #endif curl_easy_setopt (c, CURLOPT_URL, url); curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); @@ -263,7 +262,6 @@ test_file_certificates (FILE * test_fd, char *cipher_suite, int proto_version) sprintf (cert_path, "%s/%s", cur_dir, "cert.pem"); sprintf (key_path, "%s/%s", cur_dir, "key.pem"); - if (NULL == (key_fd = fopen (key_path, "w+"))) { fprintf (stderr, MHD_E_KEY_FILE_CREAT); @@ -433,11 +431,11 @@ main (int argc, char *const *argv) } errorCount += - test_secure_get (test_fd, "AES256-SHA", CURL_SSLVERSION_TLSv1); + test_secure_get (test_fd, "AES256-SHA", CURL_SSLVERSION_SSLv3); errorCount += test_secure_get (test_fd, "AES256-SHA", CURL_SSLVERSION_SSLv3); errorCount += - test_file_certificates (test_fd, "AES256-SHA", CURL_SSLVERSION_TLSv1); + test_file_certificates (test_fd, "AES256-SHA", CURL_SSLVERSION_SSLv3); /* TODO resolve cipher setting issue when compiling against GNU TLS */ errorCount += test_cipher_option (test_fd, "DES-CBC3-SHA", CURL_SSLVERSION_SSLv3); @@ -445,10 +443,10 @@ main (int argc, char *const *argv) test_kx_option (test_fd, "EDH-RSA-DES-CBC3-SHA", CURL_SSLVERSION_SSLv3); - curl_global_cleanup (); - fclose (test_fd); + curl_global_cleanup (); + fclose (test_fd); - remove (test_file_name); + remove (test_file_name); return errorCount != 0; } diff --git a/src/testcurl/https/mhds_multi_daemon_test.c b/src/testcurl/https/mhds_multi_daemon_test.c @@ -87,7 +87,6 @@ http_ahc (void *cls, struct MHD_Connection *connection, FILE *file; struct stat buf; - /* TODO never respond on first call */ if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) return MHD_NO; /* unexpected method */ if (&aptr != *ptr) diff --git a/src/testcurl/https/tls_authentication_test.c b/src/testcurl/https/tls_authentication_test.c @@ -89,7 +89,6 @@ http_ahc (void *cls, struct MHD_Connection *connection, FILE *file; struct stat buf; - // TODO never respond on first call if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) return MHD_NO; /* unexpected method */ if (&aptr != *ptr)