out string checksum, out string label) {
/* http://foo.bar/baz/spam.eggs#!algo!123456 */
+ unowned string display = null;
+ GLib.ChecksumType type = (GLib.ChecksumType)int.MAX;
+
unowned string delimiter = "#!md5!";
- unowned string display = _("MD5-Checksum:");
- GLib.ChecksumType type = GLib.ChecksumType.MD5;
unowned string? fragment = uri.str (delimiter);
- if (fragment == null) {
- delimiter = "#!sha1!";
+ if (fragment != null) {
+ display = _("MD5-Checksum:");
+ type = GLib.ChecksumType.MD5;
+ }
+
+ delimiter = "#!sha1!";
+ fragment = uri.str (delimiter);
+ if (fragment != null) {
display = _("SHA1-Checksum:");
type = GLib.ChecksumType.SHA1;
- fragment = uri.str (delimiter);
- }
- if (fragment == null) {
- type = (GLib.ChecksumType)int.MAX;
- display = null;
}
+ /* No SHA256: no known usage and no need for strong encryption */
+
if (&checksum != null)
checksum = fragment != null
? fragment.offset (delimiter.length) : null;
g_assert_cmpint (midori_uri_get_fingerprint (uri, NULL, NULL), ==, G_MAXINT);
uri = "http://midori-0.4.1.tar.bz2#abcdefg";
g_assert_cmpint (midori_uri_get_fingerprint (uri, NULL, NULL), ==, G_MAXINT);
+ uri = "http://midori-0.4.1.tar.bz2";
+ g_assert_cmpint (midori_uri_get_fingerprint (uri, NULL, NULL), ==, G_MAXINT);
}
static void