aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-format.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-12-15 01:57:08 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-12-15 01:57:08 +0800
commit37f1f773e220fa6402bf5f21f5bf78fed1801d37 (patch)
treee3e927718494d351fc3500d7032aca32361c4766 /mail/mail-format.c
parent969ffa703d70be312a9b9b2f7a6d2b7a8ac87c17 (diff)
downloadgsoc2013-evolution-37f1f773e220fa6402bf5f21f5bf78fed1801d37.tar.gz
gsoc2013-evolution-37f1f773e220fa6402bf5f21f5bf78fed1801d37.tar.zst
gsoc2013-evolution-37f1f773e220fa6402bf5f21f5bf78fed1801d37.zip
Start reiplementing The Right Way and not danw's fucking half-assed kludge
2001-12-14 Jeffrey Stedfast <fejj@ximian.com> * mail-format.c (try_inline_pgp): (try_inline_pgp_sig): Start reiplementing The Right Way and not danw's fucking half-assed kludge that doesn't work. svn path=/trunk/; revision=15076
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r--mail/mail-format.c97
1 files changed, 2 insertions, 95 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c
index 2deda8565a..68b51e8265 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -1350,107 +1350,14 @@ static char *
try_inline_pgp (char *start, CamelMimePart *mime_part,
guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
- CamelMimePart *part;
- CamelMultipart *multipart;
- char *end;
-
- end = strstr (start, "\n-----END PGP MESSAGE-----\n");
- if (!end)
- return start;
-
- end += sizeof ("\n-----END PGP MESSAGE-----\n") - 1;
-
- multipart = camel_multipart_new ();
- camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (multipart),
- "multipart/encrypted; "
- "protocol=\"application/pgp-encrypted\"; "
- "x-inline-pgp-hack=true");
-
- part = fake_mime_part_from_data ("Version: 1\n",
- sizeof ("Version: 1\n") - 1,
- "application/pgp-encrypted",
- offset + 1, md);
- camel_multipart_add_part (multipart, part);
- camel_object_unref (CAMEL_OBJECT (part));
-
- part = fake_mime_part_from_data (start, end - start + 1,
- "application/octet-stream",
- offset, md);
- camel_multipart_add_part (multipart, part);
- camel_object_unref (CAMEL_OBJECT (part));
-
- part = camel_mime_part_new ();
- camel_medium_set_content_object (CAMEL_MEDIUM (part),
- CAMEL_DATA_WRAPPER (multipart));
-
- camel_object_hook_event (CAMEL_OBJECT (md->current_message),
- "finalize", destroy_part, part);
-
- write_hr (html, stream);
- format_mime_part (part, md, html, stream);
-
- return end;
+ return start;
}
static char *
try_inline_pgp_sig (char *start, CamelMimePart *mime_part,
guint offset, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream)
{
- CamelMimePart *part;
- CamelMultipart *multipart;
- char *msg_start, *msg_end, *sig_start, *sig_end;
- CamelContentType *type;
- char *type_str;
-
- /* We know start points to "-----BEGIN PGP SIGNED MESSAGE-----\n" */
- msg_start = start + sizeof ("-----BEGIN PGP SIGNED MESSAGE-----\n") - 1;
- /* Skip 'One or more "Hash" Armor Headers' followed by
- * 'Exactly one empty line'.
- */
- msg_start = strstr (msg_start, "\n\n");
- if (!msg_start)
- return start;
- msg_start += 2;
- msg_end = strstr (msg_start, "\n-----BEGIN PGP SIGNATURE-----\n");
- if (!msg_end)
- return start;
-
- sig_start = msg_end;
- sig_end = strstr (sig_start, "\n-----END PGP SIGNATURE-----\n");
- if (!sig_end)
- return start;
- sig_end += sizeof ("\n-----END PGP SIGNATURE-----\n") - 1;
-
- multipart = camel_multipart_new ();
- camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (multipart),
- "multipart/signed; micalg=pgp-sha1;"
- "x-inline-pgp-hack=true");
-
- type = camel_mime_part_get_content_type (mime_part);
- type_str = header_content_type_format (type);
- part = fake_mime_part_from_data (msg_start, msg_end - msg_start,
- type_str, offset, md);
- g_free (type_str);
- camel_multipart_add_part (multipart, part);
- camel_object_unref (CAMEL_OBJECT (part));
-
- part = fake_mime_part_from_data (sig_start, sig_end - sig_start,
- "application/pgp-signature",
- offset + 1, md);
- camel_multipart_add_part (multipart, part);
- camel_object_unref (CAMEL_OBJECT (part));
-
- part = camel_mime_part_new ();
- camel_medium_set_content_object (CAMEL_MEDIUM (part),
- CAMEL_DATA_WRAPPER (multipart));
-
- camel_object_hook_event (CAMEL_OBJECT (md->current_message),
- "finalize", destroy_part, part);
-
- write_hr (html, stream);
- format_mime_part (part, md, html, stream);
-
- return sig_end;
+ return start;
}
static char *