2008-05-15 [colin] 3.4.0cvs41
authorColin Leroy <colin@colino.net>
Thu, 15 May 2008 20:50:09 +0000 (20:50 +0000)
committerColin Leroy <colin@colino.net>
Thu, 15 May 2008 20:50:09 +0000 (20:50 +0000)
* src/gtk/sslcertwindow.c
Print SHA1 fingerprint too

ChangeLog
PATCHSETS
configure.ac
src/gtk/sslcertwindow.c

index 11991ea..03f4fa4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-15 [colin]     3.4.0cvs41
+
+       * src/gtk/sslcertwindow.c
+               Print SHA1 fingerprint too
+
 2008-05-15 [colin]     3.4.0cvs40
 
        * src/imap.c
index 2025d57..7c860e5 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.48 -r 1.1.2.49 manual/advanced.xml;  ) > 3.4.0cvs38.patchset
 ( cvs diff -u -r 1.179.2.217 -r 1.179.2.218 src/imap.c;  ) > 3.4.0cvs39.patchset
 ( cvs diff -u -r 1.179.2.218 -r 1.179.2.219 src/imap.c;  cvs diff -u -r 1.9.2.20 -r 1.9.2.21 src/gtk/sslcertwindow.c;  ) > 3.4.0cvs40.patchset
+( cvs diff -u -r 1.9.2.21 -r 1.9.2.22 src/gtk/sslcertwindow.c;  ) > 3.4.0cvs41.patchset
index 8909380..27e03ba 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=40
+EXTRA_VERSION=41
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 937498c..5587c6e 100644 (file)
@@ -64,7 +64,8 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
        
        char *issuer_commonname, *issuer_location, *issuer_organization;
        char *subject_commonname, *subject_location, *subject_organization;
-       char *fingerprint, *sig_status, *exp_date;
+       char *sig_status, *exp_date;
+       char *md5_fingerprint, *sha1_fingerprint, *fingerprint;
        unsigned int n;
        char buf[100];
        unsigned char md[128];  
@@ -202,14 +203,18 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
        /* fingerprint */
 #if USE_OPENSSL
        X509_digest(cert->x509_cert, EVP_md5(), md, &n);
-       fingerprint = readable_fingerprint(md, (int)n);
+       md5_fingerprint = readable_fingerprint(md, (int)n);
+       X509_digest(cert->x509_cert, EVP_sha1(), md, &n);
+       sha1_fingerprint = readable_fingerprint(md, (int)n);
 
        /* signature */
        sig_status = ssl_certificate_check_signer(cert->x509_cert);
 #else
        n = 128;
        gnutls_x509_crt_get_fingerprint(cert->x509_cert, GNUTLS_DIG_MD5, md, &n);
-       fingerprint = readable_fingerprint(md, (int)n);
+       md5_fingerprint = readable_fingerprint(md, (int)n);
+       gnutls_x509_crt_get_fingerprint(cert->x509_cert, GNUTLS_DIG_SHA1, md, &n);
+       sha1_fingerprint = readable_fingerprint(md, (int)n);
 
        /* signature */
        sig_status = ssl_certificate_check_signer(cert->x509_cert, cert->status);
@@ -277,10 +282,13 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
        gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
        gtk_table_attach(signer_table, label, 1, 2, 2, 3, GTK_EXPAND|GTK_FILL, 0, 0, 0);
 
-       label = gtk_label_new(_("Fingerprint: "));
+       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", 
+                       md5_fingerprint, sha1_fingerprint);
        label = gtk_label_new(fingerprint);
+       g_free(fingerprint);
        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, 0, 1, GTK_EXPAND|GTK_FILL, 0, 0, 0);
@@ -316,7 +324,8 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
        g_free(subject_commonname);
        g_free(subject_location);
        g_free(subject_organization);
-       g_free(fingerprint);
+       g_free(md5_fingerprint);
+       g_free(sha1_fingerprint);
        g_free(sig_status);
        g_free(exp_date);
        return vbox;