<<< Date Index >>>     <<< Thread Index >>>

[PATCH] Minor bug when displaying clearsigned messages



A contributor to the gnupg-users mailing list frequently sends
clearsigned mails that (after invoking check-traditional-pgp on them)
do not display properly.  After doing some digging, I think I've found
what the problem is.  Mutt is looking for a blank line to separate the
ascii armor headers from the message data, and his mailer seems to be
adding spaces to the end of lines.

Note that this has nothing to do with verifying the signature or not.
The signature does verify properly, as GnuPG correctly removes the
spaces as per the OpenPGP spec.  This is only a mutt issue with
displaying such messages.

I've attached an example message to illustrate the problem, and here
is a patch that fixes it.  This applies to 1.5.6i (CVS from today)

Index: pgp.c
===================================================================
RCS file: /home/roessler/cvs/mutt/pgp.c,v
retrieving revision 3.32
diff -u -r3.32 pgp.c
--- pgp.c       21 Dec 2004 09:46:24 -0000      3.32
+++ pgp.c       26 Jan 2005 18:59:23 -0000
@@ -206,7 +206,8 @@
     
     if (armor_header)
     {
-      if (buf[0] == '\n') 
+      char *p=mutt_skip_whitespace (buf);
+      if (p[0] == '\0') 
        armor_header = 0;
       continue;
     }

David
From foo@xxxxxxxxxxx Wed Jan 26 12:55:25 2005
From: foo@xxxxxxxxxxx
To: bar@xxxxxxxxxxx
Subject: My test message
Status: RO
Content-Length: 302
Lines: 12

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
foo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1-cvs (GNU/Linux)

iGoEARECACoFAkH333sjGGh0dHA6Ly93d3cuamFiYmVyd29ja3kuY29tL2tleS5h
c2MACgkQ4mZch0nhy8lNGQCaAk62Qi+siSzE8nxc5mwAVrCqybgAoJMAf51Ic9aN
FrJ8NvzzKNMqPjWn
=NveH
-----END PGP SIGNATURE-----