[glib-networking] gnutls: Update required version of gnutls to 2.11.0



commit 23583ebd4bc0086297ebdfbbf1bde02a37fca826
Author: Stef Walter <stefw collabora co uk>
Date:   Fri Aug 19 14:44:20 2011 +0200

    gnutls: Update required version of gnutls to 2.11.0
    
     * This is required for PKCS#11 database stuff.
     * Get rid of deprecated function use
     * Compatible with gnutls 3.0.x
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656903

 configure.ac                             |    5 ++++-
 tls/gnutls/gtlsclientconnection-gnutls.c |    6 +++---
 tls/gnutls/gtlsconnection-gnutls.c       |    4 ++--
 tls/gnutls/gtlsconnection-gnutls.h       |    2 +-
 tls/gnutls/gtlsserverconnection-gnutls.c |   18 +++++++++++++-----
 5 files changed, 23 insertions(+), 12 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6d5a94c..4f1e79a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,13 +80,16 @@ AC_SUBST(GSETTINGS_DESKTOP_SCHEMAS_CFLAGS)
 dnl *****************************
 dnl *** Checks for GNUTLS     ***
 dnl *****************************
+
+GNUTLS_MIN_REQUIRED=2.11.0
+
 AC_ARG_WITH(gnutls,
     [AC_HELP_STRING([--with-gnutls],
                     [support for GNUTLS @<:@default=yes@:>@])],
     [],
     [with_gnutls=yes])
 AS_IF([test "x$with_gnutls" != "xno"],
-    [PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.1.7],
+    [PKG_CHECK_MODULES(GNUTLS, [gnutls >= $GNUTLS_MIN_REQUIRED],
         [with_gnutls=yes
 	 tls_support=gnutls
 	 AM_PATH_LIBGCRYPT([])],
diff --git a/tls/gnutls/gtlsclientconnection-gnutls.c b/tls/gnutls/gtlsclientconnection-gnutls.c
index 119f194..aa5903d 100644
--- a/tls/gnutls/gtlsclientconnection-gnutls.c
+++ b/tls/gnutls/gtlsclientconnection-gnutls.c
@@ -66,7 +66,7 @@ static int g_tls_client_connection_gnutls_retrieve_function (gnutls_session_t
 							     int                          nreqs,
 							     const gnutls_pk_algorithm_t *pk_algos,
 							     int                          pk_algos_length,
-							     gnutls_retr_st              *st);
+							     gnutls_retr2_st             *st);
 
 G_DEFINE_TYPE_WITH_CODE (GTlsClientConnectionGnutls, g_tls_client_connection_gnutls, G_TYPE_TLS_CONNECTION_GNUTLS,
 			 G_IMPLEMENT_INTERFACE (G_TYPE_TLS_CLIENT_CONNECTION,
@@ -120,7 +120,7 @@ g_tls_client_connection_gnutls_init (GTlsClientConnectionGnutls *gnutls)
   gnutls->priv = G_TYPE_INSTANCE_GET_PRIVATE (gnutls, G_TYPE_TLS_CLIENT_CONNECTION_GNUTLS, GTlsClientConnectionGnutlsPrivate);
 
   creds = g_tls_connection_gnutls_get_credentials (G_TLS_CONNECTION_GNUTLS (gnutls));
-  gnutls_certificate_client_set_retrieve_function (creds, g_tls_client_connection_gnutls_retrieve_function);
+  gnutls_certificate_set_retrieve_function (creds, g_tls_client_connection_gnutls_retrieve_function);
 }
 
 static const gchar *
@@ -282,7 +282,7 @@ g_tls_client_connection_gnutls_retrieve_function (gnutls_session_t             s
 						  int                          nreqs,
 						  const gnutls_pk_algorithm_t *pk_algos,
 						  int                          pk_algos_length,
-						  gnutls_retr_st              *st)
+						  gnutls_retr2_st             *st)
 {
   GTlsClientConnectionGnutls *gnutls = gnutls_transport_get_ptr (session);
   GPtrArray *accepted_cas;
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index f8d624a..5eb3d51 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -472,13 +472,13 @@ g_tls_connection_gnutls_get_session (GTlsConnectionGnutls *gnutls)
 
 void
 g_tls_connection_gnutls_get_certificate (GTlsConnectionGnutls *gnutls,
-					 gnutls_retr_st       *st)
+                                         gnutls_retr2_st      *st)
 {
   GTlsCertificate *cert;
 
   cert = g_tls_connection_get_certificate (G_TLS_CONNECTION (gnutls));
 
-  st->type = GNUTLS_CRT_X509;
+  st->cert_type = GNUTLS_CRT_X509;
   if (cert)
     {
       GTlsCertificateGnutls *gnutlscert = G_TLS_CERTIFICATE_GNUTLS (cert);
diff --git a/tls/gnutls/gtlsconnection-gnutls.h b/tls/gnutls/gtlsconnection-gnutls.h
index dd061c4..a169d40 100644
--- a/tls/gnutls/gtlsconnection-gnutls.h
+++ b/tls/gnutls/gtlsconnection-gnutls.h
@@ -53,7 +53,7 @@ GType g_tls_connection_gnutls_get_type (void) G_GNUC_CONST;
 gnutls_certificate_credentials g_tls_connection_gnutls_get_credentials (GTlsConnectionGnutls *connection);
 gnutls_session                 g_tls_connection_gnutls_get_session     (GTlsConnectionGnutls *connection);
 void                           g_tls_connection_gnutls_get_certificate (GTlsConnectionGnutls *gnutls,
-									 gnutls_retr_st       *st);
+                                                                        gnutls_retr2_st      *st);
 
 gssize   g_tls_connection_gnutls_read          (GTlsConnectionGnutls  *gnutls,
 						void                  *buffer,
diff --git a/tls/gnutls/gtlsserverconnection-gnutls.c b/tls/gnutls/gtlsserverconnection-gnutls.c
index 2b688f0..637317e 100644
--- a/tls/gnutls/gtlsserverconnection-gnutls.c
+++ b/tls/gnutls/gtlsserverconnection-gnutls.c
@@ -54,8 +54,12 @@ static void     g_tls_server_connection_gnutls_finish_handshake (GTlsConnectionG
 
 static void g_tls_server_connection_gnutls_server_connection_interface_init (GTlsServerConnectionInterface *iface);
 
-static int g_tls_server_connection_gnutls_retrieve_function (gnutls_session_t  session,
-							     gnutls_retr_st   *st);
+static int g_tls_server_connection_gnutls_retrieve_function (gnutls_session_t             session,
+                                                             const gnutls_datum_t        *req_ca_rdn,
+                                                             int                          nreqs,
+                                                             const gnutls_pk_algorithm_t *pk_algos,
+                                                             int                          pk_algos_length,
+                                                             gnutls_retr2_st             *st);
 
 G_DEFINE_TYPE_WITH_CODE (GTlsServerConnectionGnutls, g_tls_server_connection_gnutls, G_TYPE_TLS_CONNECTION_GNUTLS,
 			 G_IMPLEMENT_INTERFACE (G_TYPE_TLS_SERVER_CONNECTION,
@@ -97,7 +101,7 @@ g_tls_server_connection_gnutls_init (GTlsServerConnectionGnutls *gnutls)
   gnutls->priv = G_TYPE_INSTANCE_GET_PRIVATE (gnutls, G_TYPE_TLS_SERVER_CONNECTION_GNUTLS, GTlsServerConnectionGnutlsPrivate);
 
   creds = g_tls_connection_gnutls_get_credentials (G_TLS_CONNECTION_GNUTLS (gnutls));
-  gnutls_certificate_server_set_retrieve_function (creds, g_tls_server_connection_gnutls_retrieve_function);
+  gnutls_certificate_set_retrieve_function (creds, g_tls_server_connection_gnutls_retrieve_function);
 }
 
 static void
@@ -139,8 +143,12 @@ g_tls_server_connection_gnutls_set_property (GObject      *object,
 }
 
 static int
-g_tls_server_connection_gnutls_retrieve_function (gnutls_session_t  session,
-						  gnutls_retr_st   *st)
+g_tls_server_connection_gnutls_retrieve_function (gnutls_session_t             session,
+                                                  const gnutls_datum_t        *req_ca_rdn,
+                                                  int                          nreqs,
+                                                  const gnutls_pk_algorithm_t *pk_algos,
+                                                  int                          pk_algos_length,
+                                                  gnutls_retr2_st             *st)
 {
   g_tls_connection_gnutls_get_certificate (gnutls_transport_get_ptr (session), st);
   return 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]