TLS backends: minor corrections

This commit is contained in:
Evgeny Grin (Karlson2k)
2024-11-28 14:36:45 +03:00
parent 1e2f00d3ee
commit a13c8742f4
4 changed files with 21 additions and 4 deletions
+12
View File
@@ -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
*/
+3
View File
@@ -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
+2
View File
@@ -35,6 +35,8 @@
#include "tls_gnu_tls_lib.h"
#include "sys_bool_type.h"
#ifndef NDEBUG
struct mhd_TlsGnuConnDebug
{
+4 -4
View File
@@ -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 */