From: Nikos Mavrogiannopoulos Date: Sat, 4 Apr 2015 06:53:33 +0000 (+0200) Subject: cleanups in supplemental data support X-Git-Tag: gnutls_3_4_0~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=695cb86dc69fd1ffaa75d0f655a4447dbd5d44e7;p=thirdparty%2Fgnutls.git cleanups in supplemental data support --- diff --git a/lib/gnutls_supplemental.c b/lib/gnutls_supplemental.c index 34bd67668a..049bdfba20 100644 --- a/lib/gnutls_supplemental.c +++ b/lib/gnutls_supplemental.c @@ -248,7 +248,10 @@ _gnutls_supplemental_register(gnutls_supplemental_entry *entry) * * This function will register a new supplemental data type (rfc4680). * The registered data will remain until gnutls_global_deinit() - * is called. This function is not thread safe. + * is called. The provided @type must be an unassigned type in + * %gnutls_supplemental_data_format_type_t. + * + * This function is not thread safe. * * Returns: %GNUTLS_E_SUCCESS on success, otherwise a negative error code. * @@ -260,7 +263,7 @@ gnutls_supplemental_register(const char *name, gnutls_supplemental_data_format_t { gnutls_supplemental_entry tmp_entry; - tmp_entry.name = strdup(name); + tmp_entry.name = gnutls_strdup(name); tmp_entry.type = type; tmp_entry.supp_recv_func = recv_func; tmp_entry.supp_send_func = send_func; diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index e2fb17f82e..631bdc6fd5 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -1054,11 +1054,13 @@ unsigned gnutls_session_etm_status(gnutls_session_t session); /** * gnutls_supplemental_data_format_type_t: - * @GNUTLS_SUPPLEMENTAL_USER_MAPPING_DATA: Supplemental user mapping data. + * @GNUTLS_SUPPLEMENTAL_UNKNOWN: Unknown data format * * Enumeration of different supplemental data types (RFC 4680). */ -typedef int gnutls_supplemental_data_format_type_t; +typedef enum { + GNUTLS_SUPPLEMENTAL_UNKNOWN = 0, +} gnutls_supplemental_data_format_type_t; const char *gnutls_supplemental_get_name(gnutls_supplemental_data_format_type_t type);