]> granicus.if.org Git - mutt/commitdiff
GPGME: Stop parsing message as soon as PGP header is found.
authorBrendan Cully <brendan@kublai.com>
Thu, 5 Jul 2007 00:22:24 +0000 (17:22 -0700)
committerBrendan Cully <brendan@kublai.com>
Thu, 5 Jul 2007 00:22:24 +0000 (17:22 -0700)
Use file_to_data_object to build data for inline signature
verification instead of doing it by hand. This fixes inline
verification for me.

TODO: crypt-gpgme helper functions seem to return lots of pointers off
the stack in very dubious ways.

ChangeLog
crypt-gpgme.c

index 3edf62749afd2bcad5acf3e19cda76bd8f89292e..a71b7e453d0a8a66fc64248230826ff21387eb5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-27 10:38 -0700  Dan Fandrich  <dan@coneharvesters.com>  (3354ac2e79c7)
+
+       * pager.c: Fix %P in pager status for off_t variability.
+
+2007-06-27 10:35 -0700  Dan Fandrich  <dan@coneharvesters.com>  (095360e1b819)
+
+       * dotlock.c: remove a double inclusion of config.h
+
 2007-06-14 18:17 -0700  Sertaç  <Sertaç Ö. Yıldız>  (55cd4cb611d9)
 
        * rfc3676.c: flowed: consider a single space as a hard line break.
@@ -5,7 +13,7 @@
 
 2007-06-13 10:43 -0700  Vsevolod Volkov  <vvv@mutt.org.ua>  (8d02c65ed0b5)
 
-       * ChangeLog, po/ru.po: Updated Russian translation
+       * po/ru.po: Updated Russian translation
 
 2007-06-11 09:27 -0700  René Clerc  <rene@clerc.nl>  (5eaa1cfe80ad)
 
index 59bc5b03d84d917c5576f67d57b19fb02f05c6df..9bf771ea8ac4ce9c88477cd9a3b9f7ef3750ac89 100644 (file)
@@ -1858,9 +1858,15 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only)
     if (!mutt_strncmp ("-----BEGIN PGP ", buf, 15))
     {
       if (!mutt_strcmp ("MESSAGE-----\n", buf + 15))
+      {
        enc = 1;
+       break;
+      }
       else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15))
+      {
        sgn = 1;
+       break;
+      }
     }
   }
   safe_fclose (&tfp);
@@ -2039,25 +2045,7 @@ int pgp_gpgme_application_handler (BODY *m, STATE *s)
                            || (clearsign && (s->flags & M_VERIFY)));
           
           /* Copy PGP material to an data container */
-          armored_data = create_gpgme_data ();
-          gpgme_data_write (armored_data, buf, strlen (buf));
-          while (bytes > 0 && fgets (buf, sizeof (buf) - 1, s->fpin) != NULL)
-            {
-              offset = ftello (s->fpin);
-              bytes -= (offset - last_pos); /* don't rely on mutt_strlen(buf)*/
-              last_pos = offset;
-              
-              gpgme_data_write (armored_data, buf, strlen (buf));
-              
-              if ((needpass
-                   && !mutt_strcmp ("-----END PGP MESSAGE-----\n", buf)) 
-                  || (!needpass 
-                      && (!mutt_strcmp ("-----END PGP SIGNATURE-----\n", buf)
-                          || !mutt_strcmp (
-                                "-----END PGP PUBLIC KEY BLOCK-----\n",buf))))
-                break;
-            }
-          
+         armored_data = file_to_data_object (s->fpin, m->offset, m->length);
           /* Invoke PGP if needed */
           if (!clearsign || (s->flags & M_VERIFY))
             {