gnutls_system_global_deinit();
_gnutls_cryptodev_deinit();
+ _gnutls_supplemental_deinit();
+
#ifdef ENABLE_PKCS11
/* Do not try to deinitialize the PKCS #11 libraries
* from the destructor. If we do and the PKCS #11 modules
#include "gnutls_num.h"
typedef struct {
- const char *name;
+ char *name;
gnutls_supplemental_data_format_type_t type;
supp_recv_func supp_recv_func;
supp_send_func supp_send_func;
return NULL;
}
+void _gnutls_supplemental_deinit(void)
+{
+ unsigned i;
+
+ for (i = 0; i < suppfunc_size; i++) {
+ gnutls_free(suppfunc[i].name);
+ }
+ gnutls_free(suppfunc);
+
+ suppfunc = NULL;
+ suppfunc_size = 0;
+}
+
static supp_recv_func
get_supp_func_recv(gnutls_supplemental_data_format_type_t type)
{
* @send_func: the function to send the data
*
* This function will register a new supplemental data type (rfc4680).
+ * The registered data will remain until gnutls_global_deinit()
+ * is called.
*
* Returns: %GNUTLS_E_SUCCESS on success, otherwise a negative error code.
*
{
gnutls_supplemental_entry tmp_entry;
- tmp_entry.name = name;
+ tmp_entry.name = strdup(name);
tmp_entry.type = type;
tmp_entry.supp_recv_func = recv_func;
tmp_entry.supp_send_func = send_func;
const uint8_t * data, int data_size);
int _gnutls_gen_supplemental(gnutls_session_t session,
gnutls_buffer_st * buf);
+
+void _gnutls_supplemental_deinit(void);