]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Added gnutls_certificate_set_trust_list().
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 10 Jun 2013 17:04:55 +0000 (19:04 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 10 Jun 2013 17:08:47 +0000 (19:08 +0200)
NEWS
lib/gnutls_x509.c
lib/includes/gnutls/x509.h
lib/libgnutls.map

diff --git a/NEWS b/NEWS
index 6fc4ba841d5f8dbead8d3e9f22307c0ff0918e99..a515fe42ef8afeb27165e76c007dc030f6351af3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,7 +8,7 @@ See the end for copying conditions.
 subsystems.
 
 ** API and ABI modifications:
-No changes since last version.
+gnutls_certificate_set_trust_list: Added
 
 
 * Version 3.2.1 (released 2013-06-01)
index d67ad5bf239b16bf46df5bc0543c287c7afcfe9b..f0568de79e65c922c0bbf849fab2a9f30f81a407 100644 (file)
@@ -42,6 +42,7 @@
 #include "x509/common.h"
 #include "x509/x509_int.h"
 #include <gnutls_str_array.h>
+#include <gnutls/x509.h>
 #include "read-file.h"
 #ifdef _WIN32
 # include <wincrypt.h>
@@ -1270,10 +1271,11 @@ cleanup:
  * called more than once, in case multiple keys/certificates exist for
  * the server.  For clients that wants to send more than its own end
  * entity certificate (e.g., also an intermediate CA cert) then put
- * the certificate chain in @pcert_list. The @pcert_list and @key will
- * become part of the credentials structure and must not
- * be deallocated. They will be automatically deallocated when @res
- * is deinitialized.
+ * the certificate chain in @pcert_list. 
+ *
+ * Note that the @pcert_list and @key will become part of the credentials 
+ * structure and must not be deallocated. They will be automatically deallocated 
+ * when the @res structure is deinitialized.
  *
  * Returns: %GNUTLS_E_SUCCESS (0) on success, or a negative error code.
  *
@@ -1337,6 +1339,33 @@ cleanup:
   return ret;
 }
 
+/**
+ * gnutls_certificate_set_trust_list:
+ * @res: is a #gnutls_certificate_credentials_t structure.
+ * @tlist: is a #gnutls_x509_trust_list_t structure
+ * @flags: must be zero
+ *
+ * This function sets a trust list in the gnutls_certificate_credentials_t structure. 
+ *
+ * Note that the @tlist will become part of the credentials 
+ * structure and must not be deallocated. It will be automatically deallocated 
+ * when the @res structure is deinitialized.
+ *
+ * Returns: %GNUTLS_E_SUCCESS (0) on success, or a negative error code.
+ *
+ * Since: 3.2.2
+ **/
+void
+gnutls_certificate_set_trust_list (gnutls_certificate_credentials_t res,
+                                   gnutls_x509_trust_list_t tlist,
+                                   unsigned flags)
+{
+  gnutls_x509_trust_list_deinit(res->tlist, 1);
+
+  res->tlist = tlist;
+}
+
+
 /**
  * gnutls_certificate_set_x509_key_file:
  * @res: is a #gnutls_certificate_credentials_t structure.
index 53e020bb59f72fca555c424adfe6a4719630a250..3e2bf2b570ab733222818274909ee06c8cf5fdbc 100644 (file)
@@ -1110,6 +1110,10 @@ gnutls_x509_trust_list_remove_trust_mem(gnutls_x509_trust_list_t list,
 int
 gnutls_x509_trust_list_add_system_trust(gnutls_x509_trust_list_t list,
                                         unsigned int tl_flags, unsigned int tl_vflags);
+
+void gnutls_certificate_set_trust_list (gnutls_certificate_credentials_t res,
+                                gnutls_x509_trust_list_t tlist, unsigned flags);
+
 #ifdef __cplusplus
 }
 #endif
index e14ab6d1dcfbea02eea2fafea448940076923686..f7a41db334aad3b793f3448bc75898ae61723858 100644 (file)
@@ -911,6 +911,7 @@ GNUTLS_3_1_0 {
        gnutls_alpn_get_selected_protocol;
        gnutls_alpn_set_protocols;
        gnutls_session_set_id;
+       gnutls_certificate_set_trust_list;
 } GNUTLS_3_0_0;
 
 GNUTLS_PRIVATE {