[empathy/wip/rishi/tls: 3/3] Remove the GnuTLS dependency



commit 2ebec740c886fbc2771f7dbc3671431ecdd11699
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Mar 16 19:50:40 2017 +0100

    Remove the GnuTLS dependency
    
    GIO, backed by glib-networking, has everything that we need.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780160

 configure.ac               |    2 --
 libempathy/empathy-utils.c |   35 -----------------------------------
 libempathy/empathy-utils.h |    3 ---
 src/empathy-auth-client.c  |    2 --
 tests/empathy-tls-test.c   |    2 --
 5 files changed, 0 insertions(+), 44 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e35cbeb..fe63434 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,7 +35,6 @@ AC_COPYRIGHT([
 
 # Hardp deps
 FOLKS_REQUIRED=0.9.5
-GNUTLS_REQUIRED=2.8.5
 
 GLIB_REQUIRED=2.48.0
 AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_48, [Ignore post 2.48 deprecations])
@@ -219,7 +218,6 @@ PKG_CHECK_MODULES(EMPATHY,
    gio-2.0 >= $GLIB_REQUIRED
    gio-unix-2.0 >= $GLIB_REQUIRED
    libsecret-1 >= $LIBSECRET_REQUIRED
-   gnutls >= $GNUTLS_REQUIRED
    gmodule-export-2.0
    gobject-2.0
    gsettings-desktop-schemas
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index e834937..88e28b8 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -20,10 +20,6 @@
  * Authors: Richard Hult <richard imendio com>
  *          Martyn Russell <martyn imendio com>
  *          Xavier Claessens <xclaesse gmail com>
- *
- * Some snippets are taken from GnuTLS 2.8.6, which is distributed under the
- * same GNU Lesser General Public License 2.1 (or later) version. See
- * empathy_get_x509_certified_hostname ().
  */
 
 #include "config.h"
@@ -649,37 +645,6 @@ empathy_folks_persona_is_interesting (FolksPersona *persona)
 }
 
 gchar *
-empathy_get_x509_certificate_hostname (gnutls_x509_crt_t cert)
-{
-  gchar dns_name[256];
-  gsize dns_name_size;
-  gint idx;
-  gint res = 0;
-
-  /* this snippet is taken from GnuTLS.
-   * see gnutls/lib/x509/rfc2818_hostname.c
-   */
-  for (idx = 0; res >= 0; idx++)
-    {
-      dns_name_size = sizeof (dns_name);
-      res = gnutls_x509_crt_get_subject_alt_name (cert, idx,
-          dns_name, &dns_name_size, NULL);
-
-      if (res == GNUTLS_SAN_DNSNAME || res == GNUTLS_SAN_IPADDRESS)
-        return g_strndup (dns_name, dns_name_size);
-    }
-
-  dns_name_size = sizeof (dns_name);
-  res = gnutls_x509_crt_get_dn_by_oid (cert, GNUTLS_OID_X520_COMMON_NAME,
-      0, 0, dns_name, &dns_name_size);
-
-  if (res >= 0)
-    return g_strndup (dns_name, dns_name_size);
-
-  return NULL;
-}
-
-gchar *
 empathy_format_currency (gint amount,
     guint scale,
     const gchar *currency)
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index a9ff0d8..deb3ae8 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -27,7 +27,6 @@
 
 #include <glib.h>
 #include <glib-object.h>
-#include <gnutls/x509.h>
 #include <libxml/tree.h>
 #include <folks/folks.h>
 #include <folks/folks-telepathy.h>
@@ -85,8 +84,6 @@ gboolean empathy_connection_can_group_personas (TpConnection *connection,
                                                FolksIndividual *individual);
 gboolean empathy_folks_persona_is_interesting (FolksPersona *persona);
 
-gchar * empathy_get_x509_certificate_hostname (gnutls_x509_crt_t cert);
-
 gchar *empathy_format_currency (gint amount,
     guint scale,
     const gchar *currency);
diff --git a/src/empathy-auth-client.c b/src/empathy-auth-client.c
index 3ee478d..6b6482d 100644
--- a/src/empathy-auth-client.c
+++ b/src/empathy-auth-client.c
@@ -22,7 +22,6 @@
 #include "config.h"
 
 #include <glib/gi18n.h>
-#include <gnutls/gnutls.h>
 
 #include "empathy-auth-factory.h"
 #include "empathy-bad-password-dialog.h"
@@ -297,7 +296,6 @@ main (int argc,
   g_option_context_free (context);
 
   empathy_gtk_init ();
-  gnutls_global_init ();
   g_set_application_name (_("Empathy authentication client"));
 
   /* Make empathy and empathy-auth-client appear as the same app in
diff --git a/tests/empathy-tls-test.c b/tests/empathy-tls-test.c
index 91b0576..7b91b9d 100644
--- a/tests/empathy-tls-test.c
+++ b/tests/empathy-tls-test.c
@@ -1,6 +1,5 @@
 #include "config.h"
 
-#include <gnutls/gnutls.h>
 #include <telepathy-glib/telepathy-glib.h>
 #include <telepathy-glib/telepathy-glib-dbus.h>
 
@@ -722,7 +721,6 @@ main (int argc,
   int result;
 
   test_init (argc, argv);
-  gnutls_global_init ();
 
   g_test_add ("/tls/certificate_basics", Test, NULL,
           setup, test_certificate_mock_basics, teardown);


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