mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-10-02 04:02:18 +03:00
added microhttpsd.h
added multi_daemon_test some macro cleanup
This commit is contained in:
1 parent
df80d220e2
commit
1ba982f9ae
27 files changed
+296
-698
No files matched your search
@@ -1,12 +1,13 @@
|
||||
SUBDIRS = .
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/daemon/https/includes \
|
||||
-I$(top_srcdir)/src/include \
|
||||
-I$(top_srcdir)/src/daemon/https/tls \
|
||||
-I$(top_srcdir)/src/daemon/https/lgl \
|
||||
-I$(top_srcdir)/src/daemon/https/x509 \
|
||||
-I$(top_srcdir)/src/daemon/https/tls \
|
||||
-I$(top_srcdir)/src/daemon/https/openpgp \
|
||||
-I$(top_srcdir)/src/daemon/https/opencdk \
|
||||
-I$(top_srcdir)/src/daemon/https/includes \
|
||||
-I$(GCRYPT_CPPFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libtls.la
|
||||
|
||||
@@ -48,7 +48,7 @@ typedef int ssize_t;
|
||||
#include <sys/socket.h>
|
||||
#include <time.h>
|
||||
|
||||
// TODO check if these should go into config.h
|
||||
/* TODO check if these should go into config.h */
|
||||
#define SIZEOF_UNSIGNED_INT 4
|
||||
#define SIZEOF_UNSIGNED_LONG 8
|
||||
#define SIZEOF_UNSIGNED_LONG_INT SIZEOF_UNSIGNED_LONG
|
||||
|
||||
@@ -60,10 +60,10 @@ ASN1_TYPE _gnutls_gnutls_asn;
|
||||
*
|
||||
* This is the function where you set the logging function gnutls
|
||||
* is going to use. This function only accepts a character array.
|
||||
* Normally you may not use this function since it is only used
|
||||
* Normally you may not use this function since it is only used
|
||||
* for debugging purposes.
|
||||
*
|
||||
* gnutls_log_func is of the form,
|
||||
* gnutls_log_func is of the form,
|
||||
* void (*gnutls_log_func)( int level, const char*);
|
||||
**/
|
||||
void
|
||||
@@ -74,7 +74,7 @@ gnutls_global_set_log_function (gnutls_log_func log_func)
|
||||
|
||||
/**
|
||||
* gnutls_global_set_log_level - This function sets the logging level
|
||||
* @level: it's an integer from 0 to 9.
|
||||
* @level: it's an integer from 0 to 9.
|
||||
*
|
||||
* This is the function that allows you to set the log level.
|
||||
* The level is an integer between 0 and 9. Higher values mean
|
||||
@@ -90,15 +90,6 @@ gnutls_global_set_log_level (int level)
|
||||
_gnutls_log_level = level;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* default logging function */
|
||||
static void
|
||||
dlog (int level, const char *str)
|
||||
{
|
||||
fputs (str, stderr);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern gnutls_alloc_function gnutls_secure_malloc;
|
||||
extern gnutls_alloc_function gnutls_malloc;
|
||||
extern gnutls_free_function gnutls_free;
|
||||
@@ -121,7 +112,7 @@ int _gnutls_is_secure_mem_null (const void *);
|
||||
* is going to use. By default the libc's allocation functions (malloc(), free()),
|
||||
* are used by gnutls, to allocate both sensitive and not sensitive data.
|
||||
* This function is provided to set the memory allocation functions to
|
||||
* something other than the defaults (ie the gcrypt allocation functions).
|
||||
* something other than the defaults (ie the gcrypt allocation functions).
|
||||
*
|
||||
* This function must be called before gnutls_global_init() is called.
|
||||
*
|
||||
@@ -182,7 +173,7 @@ static int _gnutls_init = 0;
|
||||
*
|
||||
* Note that this function will also initialize libgcrypt, if it has not
|
||||
* been initialized before. Thus if you want to manually initialize libgcrypt
|
||||
* you must do it before calling this function. This is useful in cases you
|
||||
* you must do it before calling this function. This is useful in cases you
|
||||
* want to disable libgcrypt's internal lockings etc.
|
||||
*
|
||||
* This function increment a global counter, so that
|
||||
@@ -209,7 +200,7 @@ gnutls_global_init (void)
|
||||
char c;
|
||||
|
||||
if (_gnutls_init++)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
#if HAVE_WINSOCK
|
||||
{
|
||||
@@ -235,7 +226,6 @@ gnutls_global_init (void)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// bindtextdomain("mhd", "./");
|
||||
|
||||
if (gcry_control (GCRYCTL_ANY_INITIALIZATION_P) == 0)
|
||||
@@ -285,14 +275,13 @@ gnutls_global_init (void)
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
gnutls_global_set_log_function (dlog);
|
||||
gnutls_global_set_log_function (MHD_tls_log_func());
|
||||
#endif
|
||||
|
||||
/* initialize parser
|
||||
/* initialize parser
|
||||
* This should not deal with files in the final
|
||||
* version.
|
||||
*/
|
||||
|
||||
res = asn1_array2tree(pkix_asn1_tab, &_gnutls_pkix1_asn, NULL);
|
||||
if (res != ASN1_SUCCESS)
|
||||
{
|
||||
@@ -315,7 +304,7 @@ gnutls_global_init (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* gnutls_global_deinit - This function deinitializes the global data
|
||||
* gnutls_global_deinit - This function deinitializes the global data
|
||||
*
|
||||
* This function deinitializes the global data, that were initialized
|
||||
* using gnutls_global_init().
|
||||
@@ -339,7 +328,7 @@ gnutls_global_deinit (void)
|
||||
_gnutls_init--;
|
||||
}
|
||||
|
||||
/* These functions should be elsewere. Kept here for
|
||||
/* These functions should be elsewere. Kept here for
|
||||
* historical reasons.
|
||||
*/
|
||||
|
||||
@@ -348,12 +337,12 @@ gnutls_global_deinit (void)
|
||||
* @pull_func: a callback function similar to read()
|
||||
* @session: gnutls session
|
||||
*
|
||||
* This is the function where you set a function for gnutls
|
||||
* This is the function where you set a function for gnutls
|
||||
* to receive data. Normally, if you use berkeley style sockets,
|
||||
* do not need to use this function since the default (recv(2)) will
|
||||
* do not need to use this function since the default (recv(2)) will
|
||||
* probably be ok.
|
||||
*
|
||||
* PULL_FUNC is of the form,
|
||||
* PULL_FUNC is of the form,
|
||||
* ssize_t (*gnutls_pull_func)(gnutls_transport_ptr_t, void*, size_t);
|
||||
**/
|
||||
void
|
||||
@@ -373,8 +362,8 @@ gnutls_transport_set_pull_function (gnutls_session_t session,
|
||||
* sockets, you do not need to use this function since
|
||||
* the default (send(2)) will probably be ok. Otherwise you should
|
||||
* specify this function for gnutls to be able to send data.
|
||||
*
|
||||
* PUSH_FUNC is of the form,
|
||||
*
|
||||
* PUSH_FUNC is of the form,
|
||||
* ssize_t (*gnutls_push_func)(gnutls_transport_ptr_t, const void*, size_t);
|
||||
**/
|
||||
void
|
||||
|
||||
@@ -27,12 +27,15 @@
|
||||
|
||||
#include <libtasn1.h>
|
||||
|
||||
/* this mutex is used to synchronize threads attemting call gnutls_global_init / gnutls_global_deinit */
|
||||
pthread_mutex_t gnutls_init_mutex;
|
||||
|
||||
int gnutls_is_secure_memory (const void *mem);
|
||||
|
||||
extern ASN1_TYPE _gnutls_pkix1_asn;
|
||||
extern ASN1_TYPE _gnutls_gnutls_asn;
|
||||
|
||||
/* removed const from node_asn* to
|
||||
/* removed const from node_asn* to
|
||||
* prevent warnings, since libtasn1 doesn't
|
||||
* use the const keywork in its functions.
|
||||
*/
|
||||
|
||||
@@ -23,12 +23,13 @@
|
||||
*/
|
||||
|
||||
#ifndef GNUTLS_INT_H
|
||||
|
||||
#define GNUTLS_INT_H
|
||||
|
||||
#include <defines.h>
|
||||
|
||||
#include "gnutls.h"
|
||||
#include "microhttpsd.h"
|
||||
|
||||
#include "extra.h"
|
||||
#include "gnutls_mem.h"
|
||||
|
||||
@@ -36,6 +37,8 @@
|
||||
*/
|
||||
#define KEYRING_HACK
|
||||
|
||||
#define MAX(X,Y) ((X) > (Y) ? (X) : (Y));
|
||||
|
||||
#define MAX32 4294967295
|
||||
#define MAX24 16777215
|
||||
#define MAX16 65535
|
||||
@@ -49,7 +52,7 @@
|
||||
#define TLS_MAX_SESSION_ID_SIZE 32
|
||||
#define TLS_MASTER_SIZE 48
|
||||
|
||||
/* The maximum digest size of hash algorithms.
|
||||
/* The maximum digest size of hash algorithms.
|
||||
*/
|
||||
#define MAX_HASH_SIZE 64
|
||||
|
||||
@@ -112,7 +115,7 @@ typedef struct
|
||||
#include <gnutls_mpi.h>
|
||||
|
||||
typedef enum change_cipher_spec_t
|
||||
{
|
||||
{
|
||||
GNUTLS_TYPE_CHANGE_CIPHER_SPEC = 1
|
||||
} change_cipher_spec_t;
|
||||
|
||||
@@ -176,7 +179,7 @@ typedef struct auth_cred_st
|
||||
{
|
||||
gnutls_credentials_type_t algorithm;
|
||||
|
||||
/* the type of credentials depends on algorithm
|
||||
/* the type of credentials depends on algorithm
|
||||
*/
|
||||
void *credentials;
|
||||
struct auth_cred_st *next;
|
||||
@@ -202,9 +205,9 @@ struct gnutls_key_st
|
||||
*/
|
||||
mpi_t rsa[2];
|
||||
|
||||
/* this is used to hold the peers authentication data
|
||||
/* this is used to hold the peers authentication data
|
||||
*/
|
||||
/* auth_info_t structures SHOULD NOT contain malloced
|
||||
/* auth_info_t structures SHOULD NOT contain malloced
|
||||
* elements. Check gnutls_session_pack.c, and gnutls_auth.c.
|
||||
* Rememember that this should be calloced!
|
||||
*/
|
||||
@@ -287,13 +290,13 @@ typedef enum tls_ext_parse_type_t
|
||||
EXTENSION_TLS
|
||||
} tls_ext_parse_type_t;
|
||||
|
||||
/* auth_info_t structures now MAY contain malloced
|
||||
/* auth_info_t structures now MAY contain malloced
|
||||
* elements.
|
||||
*/
|
||||
|
||||
/* This structure and auth_info_t, are stored in the resume database,
|
||||
* and are restored, in case of resume.
|
||||
* Holds all the required parameters to resume the current
|
||||
* Holds all the required parameters to resume the current
|
||||
* session.
|
||||
*/
|
||||
|
||||
@@ -321,7 +324,7 @@ typedef struct
|
||||
gnutls_mac_algorithm_t write_mac_algorithm;
|
||||
gnutls_compression_method_t write_compression_algorithm;
|
||||
|
||||
/* this is the ciphersuite we are going to use
|
||||
/* this is the ciphersuite we are going to use
|
||||
* moved here from internals in order to be restored
|
||||
* on resume;
|
||||
*/
|
||||
@@ -511,7 +514,7 @@ typedef struct
|
||||
|
||||
/* this is the highest version available
|
||||
* to the peer. (advertized version).
|
||||
* This is obtained by the Handshake Client Hello
|
||||
* This is obtained by the Handshake Client Hello
|
||||
* message. (some implementations read the Record version)
|
||||
*/
|
||||
uint8_t adv_version_major;
|
||||
@@ -523,8 +526,8 @@ typedef struct
|
||||
*/
|
||||
int send_cert_req;
|
||||
|
||||
/* bits to use for DHE and DHA
|
||||
* use _gnutls_dh_get_prime_bits() and gnutls_dh_set_prime_bits()
|
||||
/* bits to use for DHE and DHA
|
||||
* use _gnutls_dh_get_prime_bits() and gnutls_dh_set_prime_bits()
|
||||
* to access it.
|
||||
*/
|
||||
uint16_t dh_prime_bits;
|
||||
|
||||
@@ -23,12 +23,10 @@
|
||||
*/
|
||||
|
||||
#ifndef GNUTLS_STR_H
|
||||
# define GNUTLS_STR_H
|
||||
#define GNUTLS_STR_H
|
||||
|
||||
#include <gnutls_int.h>
|
||||
|
||||
#define MAX(X,Y) ((X) > (Y) ? (X) : (Y));
|
||||
|
||||
void _gnutls_str_cpy (char *dest, size_t dest_tot_size, const char *src);
|
||||
void _gnutls_mem_cpy (char *dest, size_t dest_tot_size, const char *src,
|
||||
size_t src_size);
|
||||
|
||||
Reference in new issue
Block a user