/soc/2015/mmcc/main: eafdf6cd6596: remove now-meaningless NSS ve...

Michael McConville mmcconville at mykolab.com
Tue Jun 23 16:02:35 EDT 2015


Changeset: eafdf6cd6596237ccc6a785e26a067e585afdd15
Author:	 Michael McConville <mmcconville at mykolab.com>
Date:	 2015-06-20 18:07 -0400
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/mmcc/main/rev/eafdf6cd6596

Description:

remove now-meaningless NSS version preproc conditions

diffstat:

 libpurple/plugins/ssl/nss-prefs.c |  18 ------------------
 libpurple/plugins/ssl/ssl-nss.c   |  13 -------------
 2 files changed, 0 insertions(+), 31 deletions(-)

diffs (122 lines):

diff --git a/libpurple/plugins/ssl/nss-prefs.c b/libpurple/plugins/ssl/nss-prefs.c
--- a/libpurple/plugins/ssl/nss-prefs.c
+++ b/libpurple/plugins/ssl/nss-prefs.c
@@ -61,9 +61,7 @@
 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)
 {
@@ -193,7 +191,6 @@ static void set_cipher_pref(const char *
 }
 
 static void set_versions(gboolean force_default) {
-#if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR >= 14 )
 	SSLVersionRange supported, enabled;
 
 	/* Get the ranges of supported and enabled SSL versions */
@@ -234,9 +231,6 @@ static void set_versions(gboolean force_
 					"0x%04hx through 0x%04hx\n", enabled.min, enabled.max);
 		}
 	}
-#else
-	purple_debug_error("nss-prefs", "Unable set SSL/TLS Versions\n");
-#endif /* NSS >= 3.14 */
 }
 
 static void set_version_pref(const char *pref, PurplePrefType type,
@@ -300,15 +294,12 @@ get_plugin_pref_frame(PurplePlugin *plug
 	PurplePluginPref *ppref;
 	int offset;
 	GList *tmp;
-#if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR >= 14 )
 	SSLVersionRange supported, enabled;
-#endif /* NSS >= 3.14 */
 
 	frame = purple_plugin_pref_frame_new();
 
 	ppref = purple_plugin_pref_new_with_label(_("TLS/SSL Versions"));
 	purple_plugin_pref_frame_add(frame, ppref);
-#if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR >= 14 )
 	/* Get the ranges of supported and enabled SSL versions */
 	if ((SSL_VersionRangeGetSupported(ssl_variant_stream, &supported) == SECSuccess) &&
 			(SSL_VersionRangeGetDefault(ssl_variant_stream, &enabled) == SECSuccess)) {
@@ -357,13 +348,6 @@ get_plugin_pref_frame(PurplePlugin *plug
 		purple_plugin_pref_frame_add(frame, ppref);
 		purple_plugin_pref_frame_add(frame, ppref_max);
 	}
-#else
-	/* TODO: look into how to do this for older versions? */
-
-	ppref = purple_plugin_pref_new_with_label(_("Not Supported for NSS < 3.14"));
-	purple_plugin_pref_frame_add(frame, ppref);
-
-#endif /* NSS >= 3.14 */
 
 	ppref = purple_plugin_pref_new_with_label(_("Ciphers"));
 	purple_plugin_pref_frame_add(frame, ppref);
@@ -500,10 +484,8 @@ plugin_unload(PurplePlugin *plugin, GErr
 	}
 
 	set_versions(TRUE);
-#if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR >= 14 )
 	g_free(default_versions);
 	default_versions = NULL;
-#endif
 
 	return TRUE;
 }
diff --git a/libpurple/plugins/ssl/ssl-nss.c b/libpurple/plugins/ssl/ssl-nss.c
--- a/libpurple/plugins/ssl/ssl-nss.c
+++ b/libpurple/plugins/ssl/ssl-nss.c
@@ -140,18 +140,12 @@ static gchar *get_error_text(void)
 }
 
 static const PRUint16 default_ciphers[] = {
-#if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR > 15 ) \
-		|| ( NSS_VMAJOR == 3 && NSS_VMINOR == 15 && NSS_VPATCH >= 1 )
 	TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
 	TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
 	TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
-# if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR > 15 ) \
-		|| ( NSS_VMAJOR == 3 && NSS_VMINOR == 15 && NSS_VPATCH >= 2 )
 	TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
 	TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
 	TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
-# endif
-#endif
 	TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
 	TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
 
@@ -226,19 +220,13 @@ static void ssl_nss_init_ciphers(void) {
 static void
 ssl_nss_init_nss(void)
 {
-#if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR >= 14 )
 	SSLVersionRange supported, enabled;
-#endif /* NSS >= 3.14 */
 
 	PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
 	NSS_NoDB_Init(".");
-#if (NSS_VMAJOR == 3 && (NSS_VMINOR < 15 || (NSS_VMINOR == 15 && NSS_VPATCH < 2)))
-	NSS_SetDomesticPolicy();
-#endif /* NSS < 3.15.2 */
 
 	ssl_nss_init_ciphers();
 
-#if NSS_VMAJOR > 3 || ( NSS_VMAJOR == 3 && NSS_VMINOR >= 14 )
 	/* Get the ranges of supported and enabled SSL versions */
 	if ((SSL_VersionRangeGetSupported(ssl_variant_stream, &supported) == SECSuccess) &&
 			(SSL_VersionRangeGetDefault(ssl_variant_stream, &enabled) == SECSuccess)) {
@@ -263,7 +251,6 @@ ssl_nss_init_nss(void)
 			}
 		}
 	}
-#endif /* NSS >= 3.14 */
 
 	/** Disable OCSP Checking until we can make that use our HTTP & Proxy stuff */
 	CERT_EnableOCSPChecking(PR_FALSE);



More information about the Commits mailing list