From 59808e680048b3205dfb7b7a13ca9de2e8754428 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 16 Mar 2017 19:50:40 +0100 Subject: 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, 44 deletions(-) diff --git a/configure.ac b/configure.ac index e35cbebe5..fe63434ee 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 e83493736..88e28b8dd 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -20,10 +20,6 @@ * Authors: Richard Hult * Martyn Russell * Xavier Claessens - * - * 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" @@ -648,37 +644,6 @@ empathy_folks_persona_is_interesting (FolksPersona *persona) return TRUE; } -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, diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index a9ff0d890..deb3ae87b 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -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 3ee478d3e..6b6482d4b 100644 --- a/src/empathy-auth-client.c +++ b/src/empathy-auth-client.c @@ -22,7 +22,6 @@ #include "config.h" #include -#include #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 b8f9ffcbb..9b62ae4e0 100644 --- a/tests/empathy-tls-test.c +++ b/tests/empathy-tls-test.c @@ -1,6 +1,5 @@ #include "config.h" -#include #include #include @@ -744,7 +743,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); -- cgit v1.2.1