Fix building with NSS 3.10.8 (which is what squeeze has and is probably the oldest we need to worry about) release-2.x.y

Wed, 05 Nov 2014 00:07:54 -0500

author
Daniel Atallah <datallah@pidgin.im>
date
Wed, 05 Nov 2014 00:07:54 -0500
branch
release-2.x.y
changeset 36219
703e982d8d18
parent 36218
ca3ea8900dc9
child 36220
f26d96f03176

Fix building with NSS 3.10.8 (which is what squeeze has and is probably the oldest we need to worry about)

libpurple/plugins/ssl/ssl-nss.c file | annotate | diff | comparison | revisions
--- a/libpurple/plugins/ssl/ssl-nss.c	Tue Nov 04 21:37:38 2014 +0100
+++ b/libpurple/plugins/ssl/ssl-nss.c	Wed Nov 05 00:07:54 2014 -0500
@@ -150,18 +150,20 @@
 
 		rv = SSL_CipherPrefGetDefault(suite, &enabled);
 		if (rv != SECSuccess) {
-			err = PR_GetError();
+			gchar *error_txt = get_error_text();
 			purple_debug_warning("nss",
 					"SSL_CipherPrefGetDefault didn't like value 0x%04x: %s\n",
-					suite, PORT_ErrorToString(err));
+					suite, error_txt);
+			g_free(error_txt);
 			continue;
 		}
 		rv = SSL_GetCipherSuiteInfo(suite, &info, (int)(sizeof info));
 		if (rv != SECSuccess) {
-			err = PR_GetError();
+			gchar *error_txt = get_error_text();
 			purple_debug_warning("nss",
 					"SSL_GetCipherSuiteInfo didn't like value 0x%04x: %s\n",
-					suite, PORT_ErrorToString(err));
+					suite, error_txt);
+			g_free(error_txt);
 			continue;
 		}
 		purple_debug_info("nss", "Cipher - %s: %s\n",
@@ -179,7 +181,7 @@
 
 	PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
 	NSS_NoDB_Init(".");
-#if (NSS_VMAJOR == 3 && (NSS_VMINOR < 15 || (NSS_VMINOR == 15 && NSS_VMICRO < 2)))
+#if (NSS_VMAJOR == 3 && (NSS_VMINOR < 15 || (NSS_VMINOR == 15 && NSS_VPATCH < 2)))
 	NSS_SetDomesticPolicy();
 #endif /* NSS < 3.15.2 */
 
@@ -1128,7 +1130,9 @@
 				case SEC_ERROR_CA_CERT_INVALID:
 				case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE:
 				case SEC_ERROR_UNTRUSTED_CERT:
+#ifdef SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED
 				case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED:
+#endif
 					if (!self_signed) {
 						*flags |= PURPLE_CERTIFICATE_INVALID_CHAIN;
 					}

mercurial