aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/tls/gnutls_global.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/tls/gnutls_global.c')
-rw-r--r--src/daemon/https/tls/gnutls_global.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/daemon/https/tls/gnutls_global.c b/src/daemon/https/tls/gnutls_global.c
index 6f7e46bf..65ac210a 100644
--- a/src/daemon/https/tls/gnutls_global.c
+++ b/src/daemon/https/tls/gnutls_global.c
@@ -94,57 +94,6 @@ MHD_gtls_global_set_log_level (int level)
94 94
95int MHD__gnutls_is_secure_mem_null (const void *); 95int MHD__gnutls_is_secure_mem_null (const void *);
96 96
97/**
98 * MHD_gtls_global_set_mem_functions - This function sets the memory allocation functions
99 * @alloc_func: it's the default memory allocation function. Like malloc().
100 * @secure_alloc_func: This is the memory allocation function that will be used for sensitive data.
101 * @is_secure_func: a function that returns 0 if the memory given is not secure. May be NULL.
102 * @realloc_func: A realloc function
103 * @free_func: The function that frees allocated data. Must accept a NULL pointer.
104 *
105 * This is the function were you set the memory allocation functions gnutls
106 * is going to use. By default the libc's allocation functions (malloc(), free()),
107 * are used by gnutls, to allocate both sensitive and not sensitive data.
108 * This function is provided to set the memory allocation functions to
109 * something other than the defaults (ie the gcrypt allocation functions).
110 *
111 * This function must be called before MHD__gnutls_global_init() is called.
112 *
113 **/
114void
115MHD_gtls_global_set_mem_functions (MHD_gnutls_alloc_function alloc_func,
116 MHD_gnutls_alloc_function
117 secure_alloc_func,
118 MHD_gnutls_is_secure_function
119 is_secure_func,
120 MHD_gnutls_realloc_function realloc_func,
121 MHD_gnutls_free_function free_func)
122{
123 MHD_gnutls_secure_malloc = secure_alloc_func;
124 MHD_gnutls_malloc = alloc_func;
125 MHD_gnutls_realloc = realloc_func;
126 MHD_gnutls_free = free_func;
127
128 if (is_secure_func != NULL)
129 MHD__gnutls_is_secure_memory = is_secure_func;
130 else
131 MHD__gnutls_is_secure_memory = MHD__gnutls_is_secure_mem_null;
132
133 /* if using the libc's default malloc
134 * use libc's calloc as well.
135 */
136 if (MHD_gnutls_malloc == malloc)
137 {
138 MHD_gnutls_calloc = calloc;
139 }
140 else
141 { /* use the included ones */
142 MHD_gnutls_calloc = MHD_gtls_calloc;
143 }
144 MHD_gnutls_strdup = MHD_gtls_strdup;
145
146}
147
148static int MHD__gnutls_init_level = 0; 97static int MHD__gnutls_init_level = 0;
149 98
150/** 99/**