[Xfce4-commits] <midori:master> Compare checksums without respecting case-sensitivity

Christian Dywan noreply at xfce.org
Tue Aug 2 22:58:01 CEST 2011


Updating branch refs/heads/master
         to d3f27e54f838a4b87344c6c6d4f898a69afb7668 (commit)
       from 8c7f255c7ef264482fbb712920cc75f2412fc113 (commit)

commit d3f27e54f838a4b87344c6c6d4f898a69afb7668
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Aug 2 22:55:46 2011 +0200

    Compare checksums without respecting case-sensitivity
    
    Upper-case checksums would always fail to verify.

 toolbars/midori-transferbar.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/toolbars/midori-transferbar.c b/toolbars/midori-transferbar.c
index 9cffef1..8e715af 100644
--- a/toolbars/midori-transferbar.c
+++ b/toolbars/midori-transferbar.c
@@ -150,7 +150,8 @@ midori_transferbar_download_notify_status_cb (WebKitDownload* download,
                     (guchar*)contents, length);
                 g_free (filename);
                 g_free (contents);
-                if (!y || !g_str_equal (fingerprint[1], checksum))
+                /* Checksums are case-insensitive */
+                if (!y || g_ascii_strcasecmp (fingerprint[1], checksum) != 0)
                     gtk_image_set_from_stock (GTK_IMAGE (icon),
                         GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_MENU);
                 g_free (checksum);
@@ -169,7 +170,8 @@ midori_transferbar_download_notify_status_cb (WebKitDownload* download,
                     gchar* checksum = g_compute_checksum_for_data (G_CHECKSUM_SHA1,
                         (guchar*)contents, length);
                     g_free (contents);
-                    if (!y || !g_str_equal (fingerprint[1], checksum))
+                    /* Checksums are case-insensitive */
+                    if (!y || g_ascii_strcasecmp (fingerprint[1], checksum) != 0)
                         gtk_image_set_from_stock (GTK_IMAGE (icon),
                             GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_MENU);
                     g_free (checksum);


More information about the Xfce4-commits mailing list