mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
TLS backends: minor corrections
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
#error This header should be used only if HTTPS is enabled
|
||||
#endif
|
||||
|
||||
/* ** Helper macros ** */
|
||||
|
||||
/**
|
||||
* Concatenate three arguments literally
|
||||
*/
|
||||
@@ -43,6 +45,10 @@
|
||||
#define mhd_MACRO_CONCAT3(a,b,c) mhd_MACRO_CONCAT3_ (a,b,c)
|
||||
|
||||
|
||||
/* ** Enumerate TLS backends ** */
|
||||
|
||||
/* * GnuTLS * */
|
||||
|
||||
#ifdef MHD_USE_GNUTLS
|
||||
/**
|
||||
* Defined to one if GnuTLS is enabled at build time or to zero if not enabled
|
||||
@@ -113,6 +119,9 @@
|
||||
# define mhd_TLS_MACRO_NAME_ID GNU
|
||||
#endif
|
||||
|
||||
|
||||
/* ** Functions names and structures names macros ** */
|
||||
|
||||
/**
|
||||
* Form function name specific for the selected TLS backend
|
||||
*/
|
||||
@@ -134,6 +143,9 @@
|
||||
*/
|
||||
#define mhd_TlsConnData mhd_TLS_DATA (ConnData)
|
||||
|
||||
|
||||
/* ** Forward declarations ** */
|
||||
|
||||
/**
|
||||
* The structure with daemon-specific TLS data
|
||||
*/
|
||||
|
||||
@@ -44,6 +44,9 @@
|
||||
#endif
|
||||
|
||||
#ifndef MHD_USE_GNUTLS
|
||||
/**
|
||||
* Check whether GnuTLS backend was successfully initialised globally
|
||||
*/
|
||||
# define mhd_tls_gnu_is_inited_fine() (0)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#include "tls_gnu_tls_lib.h"
|
||||
|
||||
#include "sys_bool_type.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
struct mhd_TlsGnuConnDebug
|
||||
{
|
||||
|
||||
@@ -62,10 +62,6 @@
|
||||
# include <stdio.h> /* For TLS debug printing */
|
||||
#endif
|
||||
|
||||
struct mhd_TlsGnuDaemonData; /* Forward declaration */
|
||||
|
||||
struct mhd_TlsGnuConnData; /* Forward declaration */
|
||||
|
||||
#ifdef mhd_USE_TLS_DEBUG_MESSAGES
|
||||
static void
|
||||
mhd_tls_gnu_debug_print (int level, const char *msg)
|
||||
@@ -590,6 +586,7 @@ mhd_tls_gnu_conn_handshake (struct mhd_TlsGnuConnData *restrict c_tls)
|
||||
|
||||
mhd_assert (c_tls->dbg.is_inited);
|
||||
mhd_assert (! c_tls->dbg.is_tls_handshake_completed);
|
||||
mhd_assert (! c_tls->dbg.is_finished);
|
||||
mhd_assert (! c_tls->dbg.is_failed);
|
||||
|
||||
res = gnutls_handshake (c_tls->sess);
|
||||
@@ -635,6 +632,7 @@ mhd_tls_gnu_conn_shutdown (struct mhd_TlsGnuConnData *restrict c_tls)
|
||||
|
||||
mhd_assert (c_tls->dbg.is_inited);
|
||||
mhd_assert (c_tls->dbg.is_tls_handshake_completed);
|
||||
mhd_assert (! c_tls->dbg.is_finished);
|
||||
mhd_assert (! c_tls->dbg.is_failed);
|
||||
|
||||
res = gnutls_bye (c_tls->sess,
|
||||
@@ -687,6 +685,7 @@ mhd_tls_gnu_conn_recv (struct mhd_TlsGnuConnData *restrict c_tls,
|
||||
|
||||
mhd_assert (c_tls->dbg.is_inited);
|
||||
mhd_assert (c_tls->dbg.is_tls_handshake_completed);
|
||||
mhd_assert (! c_tls->dbg.is_finished);
|
||||
mhd_assert (! c_tls->dbg.is_failed);
|
||||
|
||||
/* Check for GnuTLS return value limitation */
|
||||
@@ -744,6 +743,7 @@ mhd_tls_gnu_conn_send (struct mhd_TlsGnuConnData *restrict c_tls,
|
||||
|
||||
mhd_assert (c_tls->dbg.is_inited);
|
||||
mhd_assert (c_tls->dbg.is_tls_handshake_completed);
|
||||
mhd_assert (! c_tls->dbg.is_finished);
|
||||
mhd_assert (! c_tls->dbg.is_failed);
|
||||
|
||||
/* Check for GnuTLS return value limitation */
|
||||
|
||||
Reference in New Issue
Block a user