* sig-check.c (do_check): Properly validate v4 sigs with no hashed section
authorDavid Shaw <dshaw@jabberwocky.com>
Mon, 29 Jul 2002 03:07:11 +0000 (03:07 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Mon, 29 Jul 2002 03:07:11 +0000 (03:07 +0000)
at all.

g10/ChangeLog
g10/sig-check.c

index 69b1f38..17d16e2 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-28  David Shaw  <dshaw@jabberwocky.com>
+
+       * sig-check.c (do_check): Properly validate v4 sigs with no hashed
+       section at all.
+
 2002-07-25  David Shaw  <dshaw@jabberwocky.com>
 
        * keyedit.c (menu_revsig): Change "revsig" to honor selected uids
index 1654fe9..2430997 100644 (file)
@@ -281,8 +281,13 @@ do_check( PKT_public_key *pk, PKT_signature *sig, MD_HANDLE digest,
            md_write (digest, sig->hashed->data, n);
            n += 6;
        }
-       else
-           n = 6;
+       else {
+         /* Two octets for the (empty) length of the hashed
+             section. */
+          md_putc (digest, 0);
+         md_putc (digest, 0);
+         n = 6;
+       }
        /* add some magic */
        buf[0] = sig->version;
        buf[1] = 0xff;