cpw.darkrain42.2.6.1: b3e00d74: Better errors for certificate expiration...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed Jul 22 03:36:14 EDT 2009


-----------------------------------------------------------------
Revision: b3e00d74e70ca72acf628b9d8b6e24bbdee2d7ac
Ancestor: 6756026db7b43afd86a873113d2d9b18c38d434c
Author: darkrain42 at pidgin.im
Date: 2009-07-22T04:24:06
Branch: im.pidgin.cpw.darkrain42.2.6.1
URL: http://d.pidgin.im/viewmtn/revision/info/b3e00d74e70ca72acf628b9d8b6e24bbdee2d7ac

Modified files:
        libpurple/certificate.c

ChangeLog: 

Better errors for certificate expiration/activation checking.

-------------- next part --------------
============================================================
--- libpurple/certificate.c	5c07a25d7df9b5505c21df968c1898031ca4931b
+++ libpurple/certificate.c	7bb4f1d3aa88d5cf0c2b5c9d4b575bfecfd6526c
@@ -1502,33 +1502,35 @@ x509_tls_cached_start_verify(PurpleCerti
 	if (!ret || now > expiration || now < activation) {
 		gchar *secondary;
 
-		if (!ret)
+		if (!ret) {
 			purple_debug_error("certificate/x509/tls_cached",
 					"Failed to get validity times for certificate %s\n",
 					vrq->subject_name);
-		else if (now > expiration)
+			secondary = g_strdup_printf(_("Failed to validate expiration time "
+					"for %s"), vrq->subject_name);
+		} else if (now > expiration) {
 			purple_debug_error("certificate/x509/tls_cached",
 					"Certificate %s expired at %s\n",
 					vrq->subject_name, ctime(&expiration));
-		else
+			secondary = g_strdup_printf(_("The certificate for %s is expired."),
+					vrq->subject_name);
+		} else {
 			purple_debug_error("certificate/x509/tls_cached",
 					"Certificate %s is not yet valid, will be at %s\n",
 					vrq->subject_name, ctime(&activation));
+			secondary = g_strdup_printf(_("The certificate for %s should not "
+					"yet be in use."), vrq->subject_name);
+		}
 
-		/* FIXME 2.6.1 */
-		secondary = g_strdup_printf(_("The certificate chain presented"
-					" for %s is not valid."),
-					vrq->subject_name);
-
 		purple_notify_error(NULL, /* TODO: Probably wrong. */
-					_("SSL Certificate Error"),
-					_("Invalid certificate chain"),
-					secondary );
+				_("SSL Certificate Error"),
+				_("Invalid certificate chain"),
+				secondary );
 		g_free(secondary);
 
 		/* Okay, we're done here */
 		purple_certificate_verify_complete(vrq,
-						    PURPLE_CERTIFICATE_INVALID);
+				PURPLE_CERTIFICATE_INVALID);
 		return;
 	}
 


More information about the Commits mailing list