/pidgin/main: 2eae836141b5: Remove SSL plugins

Mike Ruprecht cmaiku at gmail.com
Thu Apr 7 13:36:20 EDT 2016


Changeset: 2eae836141b5491442f748c1a112cfad3ce20339
Author:	 Mike Ruprecht <cmaiku at gmail.com>
Date:	 2016-01-31 00:34 -0600
Branch:	 purple-ssl-to-gio
URL: https://hg.pidgin.im/pidgin/main/rev/2eae836141b5

Description:

Remove SSL plugins

Now that everything is ported to the TLS Certificate API, which uses
the Gio GTlsConnection API, these plugins are no longer used.

At the time of this commit, there is a released GnuTLS backend for
the Gio API, but not an NSS backend. It will need to be implemented
in order to use NSS. There is a WIP branch of this, but it hasn't
been touched in a while.

diffstat:

 libpurple/plugins/Makefile.am        |     1 -
 libpurple/plugins/ssl/Makefile.am    |    49 -
 libpurple/plugins/ssl/Makefile.mingw |   103 --
 libpurple/plugins/ssl/nss-prefs.c    |   511 ------------
 libpurple/plugins/ssl/ssl-gnutls.c   |  1438 ----------------------------------
 libpurple/plugins/ssl/ssl-nss.c      |  1278 ------------------------------
 libpurple/plugins/ssl/ssl.c          |   118 --
 7 files changed, 0 insertions(+), 3498 deletions(-)

diffs (truncated from 3538 to 300 lines):

diff --git a/libpurple/plugins/Makefile.am b/libpurple/plugins/Makefile.am
--- a/libpurple/plugins/Makefile.am
+++ b/libpurple/plugins/Makefile.am
@@ -5,7 +5,6 @@ DBUS_LTLIB = dbus-example.la
 endif
 
 SUBDIRS = \
-	ssl \
 	keyrings
 
 plugindir = @PURPLE_PLUGINDIR@
diff --git a/libpurple/plugins/ssl/Makefile.am b/libpurple/plugins/ssl/Makefile.am
deleted file mode 100644
--- a/libpurple/plugins/ssl/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-EXTRA_DIST = \
-		Makefile.mingw
-
-plugindir = @PURPLE_PLUGINDIR@
-
-ssl_la_LDFLAGS        = -module @PLUGIN_LDFLAGS@
-ssl_gnutls_la_LDFLAGS = -module @PLUGIN_LDFLAGS@
-ssl_nss_la_LDFLAGS    = -module @PLUGIN_LDFLAGS@
-nss_prefs_la_LDFLAGS  = -module @PLUGIN_LDFLAGS@
-
-if PLUGINS
-
-
-plugin_LTLIBRARIES = \
-	ssl.la
-if USE_GNUTLS
-plugin_LTLIBRARIES += \
-	ssl-gnutls.la
-endif
-if USE_NSS
-plugin_LTLIBRARIES += \
-	ssl-nss.la	\
-	nss-prefs.la
-endif
-
-ssl_la_SOURCES        = ssl.c
-ssl_gnutls_la_SOURCES = ssl-gnutls.c
-ssl_nss_la_SOURCES    = ssl-nss.c
-nss_prefs_la_SOURCES  = nss-prefs.c
-
-ssl_la_LIBADD        = @PURPLE_LIBS@
-ssl_gnutls_la_LIBADD = @PURPLE_LIBS@ $(GNUTLS_LIBS)
-ssl_nss_la_LIBADD    = @PURPLE_LIBS@ $(NSS_LIBS)
-nss_prefs_la_LIBADD  = @PURPLE_LIBS@ $(NSS_LIBS)
-
-endif # PLUGINS
-
-AM_CPPFLAGS = \
-	-I$(top_srcdir)/libpurple \
-	-I$(top_builddir)/libpurple \
-	$(DEBUG_CFLAGS) \
-	$(GLIB_CFLAGS) \
-	$(GPLUGIN_CFLAGS) \
-	$(PLUGIN_CFLAGS)
-
-ssl_gnutls_la_CFLAGS = $(AM_CPPFLAGS) $(GNUTLS_CFLAGS)
-ssl_nss_la_CFLAGS = $(AM_CPPFLAGS) $(NSS_CFLAGS)
-nss_prefs_la_CFLAGS = $(AM_CPPFLAGS) $(NSS_CFLAGS)
-
diff --git a/libpurple/plugins/ssl/Makefile.mingw b/libpurple/plugins/ssl/Makefile.mingw
deleted file mode 100644
--- a/libpurple/plugins/ssl/Makefile.mingw
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Makefile.mingw
-#
-# Description: Makefile for ssl plugin.
-#
-
-PIDGIN_TREE_TOP := ../../..
-include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
-
-##
-## VARIABLE DEFINITIONS
-##
-TARGET = ssl
-TARGET_NSS = ssl-nss
-TARGET_GNUTLS = ssl-gnutls
-TARGET_NSSPREFS = nss-prefs
-
-##
-## INCLUDE PATHS
-##
-INCLUDE_PATHS +=	-I. \
-			-I$(GTK_TOP)/include \
-			-I$(GTK_TOP)/include/glib-2.0 \
-			-I$(GTK_TOP)/lib/glib-2.0/include \
-			-I$(PURPLE_TOP) \
-			-I$(PURPLE_TOP)/win32 \
-			-I$(PIDGIN_TREE_TOP) \
-			-I$(NSS_TOP)/include/nspr4 \
-			-I$(NSS_TOP)/include/nss3 \
-			-I$(GNUTLS_TOP)/include
-
-LIB_PATHS += \
-			-L$(GTK_TOP)/lib \
-			-L$(PURPLE_TOP) \
-			-L$(NSS_TOP)/lib \
-			-L$(GNUTLS_TOP)/lib
-
-##
-##  SOURCES, OBJECTS
-##
-C_SRC =			ssl.c
-C_SRC_NSS =		ssl-nss.c
-C_SRC_GNUTLS =		ssl-gnutls.c
-C_SRC_NSSPREFS =	nss-prefs.c
-OBJECTS = $(C_SRC:%.c=%.o)
-OBJECTS_NSS = $(C_SRC_NSS:%.c=%.o)
-OBJECTS_GNUTLS = $(C_SRC_GNUTLS:%.c=%.o)
-OBJECTS_NSSPREFS = $(C_SRC_NSSPREFS:%.c=%.o)
-
-##
-## LIBRARIES
-##
-LIBS =	\
-			-lglib-2.0 \
-			-lgobject-2.0 \
-			-lws2_32 \
-			-lintl \
-			-lpurple \
-			-lnss3 \
-			-lnspr4 \
-			-lssl3 \
-			-lsmime3 \
-			-lgnutls
-
-include $(PIDGIN_COMMON_RULES)
-
-##
-## TARGET DEFINITIONS
-##
-.PHONY: all install clean
-
-all: $(TARGET).dll $(TARGET_NSS).dll $(TARGET_GNUTLS).dll $(TARGET_NSSPREFS).dll
-
-install: all $(PURPLE_INSTALL_PLUGINS_DIR) $(PURPLE_INSTALL_DIR)
-	cp $(TARGET).dll $(PURPLE_INSTALL_PLUGINS_DIR)
-	cp $(TARGET_NSS).dll $(PURPLE_INSTALL_PLUGINS_DIR)
-	cp $(TARGET_GNUTLS).dll $(PURPLE_INSTALL_PLUGINS_DIR)
-	cp $(TARGET_NSSPREFS).dll $(PURPLE_INSTALL_PLUGINS_DIR)
-
-$(OBJECTS) $(OBJECTS_NSS) $(OBJECTS_GNUTLS): $(PURPLE_CONFIG_H)
-
-##
-## BUILD DLL
-##
-$(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS)
-	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
-
-$(TARGET_NSS).dll: $(PURPLE_DLL) $(OBJECTS_NSS)
-	$(CC) -shared $(OBJECTS_NSS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET_NSS).dll
-
-$(TARGET_GNUTLS).dll: $(PURPLE_DLL) $(OBJECTS_GNUTLS)
-	$(CC) -shared $(OBJECTS_GNUTLS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET_GNUTLS).dll
-
-$(TARGET_NSSPREFS).dll: $(PURPLE_DLL) $(OBJECTS_NSSPREFS)
-	$(CC) -shared $(OBJECTS_NSSPREFS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET_NSSPREFS).dll
-
-##
-## CLEAN RULES
-##
-clean:
-	rm -f $(OBJECTS) $(OBJECTS_NSS) $(OBJECTS_GNUTLS) $(OBJECTS_NSSPREFS) $(TARGET).dll $(TARGET_NSS).dll $(TARGET_GNUTLS).dll $(TARGET_NSSPREFS).dll
-
-include $(PIDGIN_COMMON_TARGETS)
diff --git a/libpurple/plugins/ssl/nss-prefs.c b/libpurple/plugins/ssl/nss-prefs.c
deleted file mode 100644
--- a/libpurple/plugins/ssl/nss-prefs.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * Plugin to configure NSS
- *
- * Copyright (C) 2014, Daniel Atallah <datallah at pidgin.im>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02111-1301, USA.
- */
-#include "internal.h"
-#include "debug.h"
-#include "plugins.h"
-#include "version.h"
-
-#ifdef _WIN32
-# ifndef HAVE_LONG_LONG
-#define HAVE_LONG_LONG
-/* WINDDK_BUILD is defined because the checks around usage of
- * intrisic functions are wrong in nspr */
-#define WINDDK_BUILD
-# endif
-#endif
-
-#include <nspr.h>
-#include <nss.h>
-#include <nssb64.h>
-#include <ocsp.h>
-#include <pk11func.h>
-#include <prio.h>
-#include <secerr.h>
-#include <secmod.h>
-#include <ssl.h>
-#include <sslerr.h>
-#include <sslproto.h>
-
-/* There's a bug in some versions of this header that requires that some of
-   the headers above be included first. This is true for at least libnss
-   3.15.4. */
-#include <certdb.h>
-
-#define PLUGIN_ID "core-nss_prefs"
-
-#define PREF_BASE		"/plugins/core/nss_prefs"
-#define CIPHERS_PREF	PREF_BASE "/cipher_list"
-#define CIPHER_TMP_ROOT PREF_BASE "/ciphers_dummy_ui"
-#define CIPHER_TMP		CIPHER_TMP_ROOT "/0x%04x"
-#define MIN_TLS			PREF_BASE "/min_tls"
-#define MAX_TLS			PREF_BASE "/max_tls"
-
-static PurplePlugin *handle = NULL;
-static GList *tmp_prefs = NULL;
-static GList *default_ciphers = NULL;
-#if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR >= 14 )
-static SSLVersionRange *default_versions = NULL;
-#endif
-
-static gchar *get_error_text(void)
-{
-	PRInt32 len = PR_GetErrorTextLength();
-	gchar *ret = NULL;
-
-	if (len > 0) {
-		ret = g_malloc(len + 1);
-		len = PR_GetErrorText(ret);
-		ret[len] = '\0';
-	}
-
-	return ret;
-}
-
-static GList *get_current_cipher_list(gboolean force_default) {
-	GList *conf_ciphers = NULL;
-	if (!force_default) {
-		conf_ciphers = purple_prefs_get_string_list(CIPHERS_PREF);
-	}
-
-	/* If we don't have any specifically configured ciphers, use the
-	 * a copy of the defaults */
-	if (!conf_ciphers) {
-		GList *tmp;
-		for(tmp = default_ciphers; tmp; tmp = tmp->next) {
-			conf_ciphers = g_list_prepend(conf_ciphers, g_strdup(tmp->data));
-		}
-	}
-
-	return conf_ciphers;
-}
-
-static void
-enable_ciphers(gboolean force_default) {
-	const PRUint16 *cipher;
-	GList *conf_ciphers, *tmp;
-	SECStatus rv;
-
-	conf_ciphers = get_current_cipher_list(force_default);
-
-	/** First disable everything */
-	for (cipher = SSL_GetImplementedCiphers(); *cipher != 0; ++cipher) {
-		rv = SSL_CipherPrefSetDefault(*cipher, PR_FALSE);
-		if (rv != SECSuccess) {
-			gchar *error_msg = get_error_text();
-			purple_debug_warning("nss-prefs",
-					"Unable to disable 0x%04x: %s\n",
-					*cipher, error_msg);
-			g_free(error_msg);
-		}
-	}
-
-	for (tmp = conf_ciphers; tmp; tmp = g_list_delete_link(tmp, tmp)) {
-		guint64 parsed = g_ascii_strtoull(tmp->data, NULL, 16);
-



More information about the Commits mailing list