pidgin: a9887133: Print that specific message only when th...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Oct 16 00:46:01 EDT 2009


-----------------------------------------------------------------
Revision: a98871332460101c6e9638650081c8badad3066b
Ancestor: e5cd28dabffaedf15ae16dd9dfb64e2c0fe40e8c
Author: darkrain42 at pidgin.im
Date: 2009-10-16T04:42:39
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a98871332460101c6e9638650081c8badad3066b

Modified files:
        libpurple/certificate.c

ChangeLog: 

Print that specific message only when there is a CN; otherwise fall back
to the error from invalidity_reason_to_string().  Fixes #10519.

Thanks for pointing this out, QuLogic.

-------------- next part --------------
============================================================
--- libpurple/certificate.c	a8d7ee634762e7d65e92f79c0bf8e7b39fa60423
+++ libpurple/certificate.c	b127df20847fc8116d680e20f5f015f5922cf3be
@@ -1402,13 +1402,15 @@ x509_tls_cached_complete(PurpleCertifica
 		if (flags & PURPLE_CERTIFICATE_NAME_MISMATCH) {
 			gchar *sn = purple_certificate_get_subject_name(peer_crt);
 
-			g_string_append_printf(errors, _("The certificate claims to be "
-						"from \"%s\" instead. This could mean that you are "
-						"not connecting to the service you believe you are."),
-						sn ? sn : "(null)");
-			g_free(sn);
+			if (sn) {
+				g_string_append_printf(errors, _("The certificate claims to be "
+							"from \"%s\" instead. This could mean that you are "
+							"not connecting to the service you believe you are."),
+							sn);
+				g_free(sn);
 
-			flags &= ~PURPLE_CERTIFICATE_NAME_MISMATCH;
+				flags &= ~PURPLE_CERTIFICATE_NAME_MISMATCH;
+			}
 		}
 
 		while (i != PURPLE_CERTIFICATE_LAST) {


More information about the Commits mailing list