[Commits] [SCM] claws branch, master, updated. 3.17.0-151-g4d8b352

claws at claws-mail.org claws at claws-mail.org
Wed Nov 7 11:33:10 CET 2018


The branch, master has been updated
       via  4d8b3527479afa351d2752a1e654efd1ff5d2f14 (commit)
      from  45fa8affd2bcce904ab1fb2be9bed2aed5741ffa (commit)

Summary of changes:
 src/gtk/sslcertwindow.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)


- Log -----------------------------------------------------------------
commit 4d8b3527479afa351d2752a1e654efd1ff5d2f14
Author: Paul <paul at claws-mail.org>
Date:   Wed Nov 7 10:33:06 2018 +0000

    drop redundant md5 fingerprint; more clearly indicate expired sigs

diff --git a/src/gtk/sslcertwindow.c b/src/gtk/sslcertwindow.c
index 70cc4f9..cb3ce4c 100644
--- a/src/gtk/sslcertwindow.c
+++ b/src/gtk/sslcertwindow.c
@@ -63,7 +63,7 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
 	char *issuer_commonname, *issuer_location, *issuer_organization;
 	char *subject_commonname, *subject_location, *subject_organization;
 	char *sig_status, *exp_date;
-	char *md5_fingerprint, *sha1_fingerprint, *sha256_fingerprint, *fingerprint;
+	char *sha1_fingerprint, *sha256_fingerprint, *fingerprint;
 	size_t n;
 	char buf[100];
 	unsigned char md[128];	
@@ -144,12 +144,8 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
 
 	/* fingerprint */
 	n = 128;
-	gnutls_x509_crt_get_fingerprint(cert->x509_cert, GNUTLS_DIG_MD5, md, &n);
-	md5_fingerprint = readable_fingerprint(md, (int)n);
-	n = 128;
 	gnutls_x509_crt_get_fingerprint(cert->x509_cert, GNUTLS_DIG_SHA1, md, &n);
 	sha1_fingerprint = readable_fingerprint(md, (int)n);
-	n = 128;
 	gnutls_x509_crt_get_fingerprint(cert->x509_cert, GNUTLS_DIG_SHA256, md, &n);
 	sha256_fingerprint = readable_fingerprint(md, (int)n);
 
@@ -158,7 +154,9 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
 	sig_status = ssl_certificate_check_signer(cert, cert->status);
 
 	if (sig_status==NULL)
-		sig_status = g_strdup(_("Correct"));
+		sig_status = g_strdup_printf(_("Correct%s"),exp_time_t < time(NULL)? _(" (expired)"): "");
+	else if (exp_time_t < time(NULL))
+			  sig_status = g_strconcat(sig_status,_(" (expired)"),NULL);
 
 	vbox = gtk_vbox_new(FALSE, 5);
 	hbox = gtk_hbox_new(FALSE, 5);
@@ -222,8 +220,8 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
 	label = gtk_label_new(_("Fingerprint: \n"));
 	gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
 	gtk_table_attach(status_table, label, 0, 1, 0, 1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
-	fingerprint = g_strdup_printf("MD5: %s\nSHA1: %s\nSHA256: %s",
-			md5_fingerprint, sha1_fingerprint, sha256_fingerprint);
+	fingerprint = g_strdup_printf("SHA1: %s\nSHA256: %s",
+				      sha1_fingerprint, sha256_fingerprint);
 	label = gtk_label_new(fingerprint);
 	g_free(fingerprint);
 	gtk_label_set_selectable(GTK_LABEL(label), TRUE);
@@ -236,7 +234,7 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
 	gtk_label_set_selectable(GTK_LABEL(label), TRUE);
 	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
 	gtk_table_attach(status_table, label, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, 0, 0, 0);
-	label = gtk_label_new(_("Expires on: "));
+	label = gtk_label_new(exp_time_t < time(NULL)? _("Expired on: "): _("Expires on: "));
 	gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
 	gtk_table_attach(status_table, label, 0, 1, 2, 3, GTK_EXPAND|GTK_FILL, 0, 0, 0);
 	label = gtk_label_new(exp_date);
@@ -261,7 +259,6 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
 	g_free(subject_commonname);
 	g_free(subject_location);
 	g_free(subject_organization);
-	g_free(md5_fingerprint);
 	g_free(sha1_fingerprint);
 	g_free(sha256_fingerprint);
 	g_free(sig_status);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list