aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-05-27 05:53:42 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-05-27 05:53:42 +0800
commit6f7c4bf1ae439847f945807008a921c6d769bde2 (patch)
tree6cc8758bdf2b6cb045220aac9a1c35478d5b0642
parent1614f33b47f2fdab5cd56eab99102cca2b471b07 (diff)
downloadgsoc2013-evolution-6f7c4bf1ae439847f945807008a921c6d769bde2.tar
gsoc2013-evolution-6f7c4bf1ae439847f945807008a921c6d769bde2.tar.gz
gsoc2013-evolution-6f7c4bf1ae439847f945807008a921c6d769bde2.tar.bz2
gsoc2013-evolution-6f7c4bf1ae439847f945807008a921c6d769bde2.tar.lz
gsoc2013-evolution-6f7c4bf1ae439847f945807008a921c6d769bde2.tar.xz
gsoc2013-evolution-6f7c4bf1ae439847f945807008a921c6d769bde2.tar.zst
gsoc2013-evolution-6f7c4bf1ae439847f945807008a921c6d769bde2.zip
Fix to work properly.
2001-05-26 Jeffrey Stedfast <fejj@ximian.com> * mail-format.c (try_inline_pgp_sig): Fix to work properly. svn path=/trunk/; revision=10015
-rw-r--r--mail/ChangeLog4
-rw-r--r--mail/mail-format.c27
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 <fejj@ximian.com>
+
+ * mail-format.c (try_inline_pgp_sig): Fix to work properly.
+
2001-05-25 Jeffrey Stedfast <fejj@ximian.com>
* 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);