From 6f7c4bf1ae439847f945807008a921c6d769bde2 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 26 May 2001 21:53:42 +0000 Subject: Fix to work properly. 2001-05-26 Jeffrey Stedfast * mail-format.c (try_inline_pgp_sig): Fix to work properly. svn path=/trunk/; revision=10015 --- mail/ChangeLog | 4 ++++ mail/mail-format.c | 27 +++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index a17cab7072..54bad04fe6 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,7 @@ +2001-05-26 Jeffrey Stedfast + + * mail-format.c (try_inline_pgp_sig): Fix to work properly. + 2001-05-25 Jeffrey Stedfast * folder-browser-factory.c: Added callbacks for Next/Previous diff --git a/mail/mail-format.c b/mail/mail-format.c index 66e90d1e90..95bc7e92f6 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -1174,13 +1174,32 @@ try_inline_pgp_sig (char *start, MailDisplay *md) { CamelCipherValidity *valid = NULL; CamelPgpContext *context; - char *end, *pgp_start; + char *end, *msg_start, *pgp_start; + + msg_start = strstr (start, "-----BEGIN PGP SIGNED MESSAGE-----"); + if (msg_start) { + /* skip over -----BEGIN PGP SIGNED MESSAGE----- */ + msg_start = strchr (msg_start, '\n'); + if (!msg_start++) + return start; + + /* skip over Hash: header */ + msg_start = strchr (msg_start, '\n'); + if (!msg_start++) + return start; + } else { + /* Some MUAs don't enclose the signed text in + -----BEGIN PGP SIGNED MESSAGE----- */ + msg_start = start; + } - pgp_start = strstr (start, "-----BEGIN PGP SIGNED MESSAGE-----"); + /* find the beginning of the signature block */ + pgp_start = strstr (msg_start, "-----BEGIN PGP SIGNATURE-----"); if (!pgp_start) return start; - end = strstr (start, "-----END PGP SIGNATURE-----"); + /* find the end of the pgp signature block */ + end = strstr (pgp_start, "-----END PGP SIGNATURE-----"); if (!end) return start; @@ -1208,7 +1227,7 @@ try_inline_pgp_sig (char *start, MailDisplay *md) camel_exception_free (ex); } - mail_text_write (md->html, md->stream, "%.*s", pgp_start - start, start); + mail_text_write (md->html, md->stream, "%.*s", pgp_start - msg_start, msg_start); mail_write_authenticity (md, valid); -- cgit v1.2.3