]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
cleanups in supplemental data support
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 4 Apr 2015 06:53:33 +0000 (08:53 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 4 Apr 2015 06:53:33 +0000 (08:53 +0200)
lib/gnutls_supplemental.c
lib/includes/gnutls/gnutls.h.in

index 34bd67668a7ad294984462e91c8b3ee2c6f87701..049bdfba20ffc2c0c700cec10890a2691080f96d 100644 (file)
@@ -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;
index e2fb17f82eda2cef12f9b07581cdcc89530b6940..631bdc6fd5c8bd2abb15872685634d6a27c15562 100644 (file)
@@ -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);