aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-11-08 08:08:35 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-11-08 08:08:35 +0800
commit4a3c80cd3cc3beb41ecbdd9c7b7a9a489de4e009 (patch)
tree941b669873f3e8a2ab1e6f6ec1d9b0f5636b3ee6 /camel
parenta9f89ff0fcf1df12ad0ecc69b48566fca5820ae2 (diff)
downloadgsoc2013-evolution-4a3c80cd3cc3beb41ecbdd9c7b7a9a489de4e009.tar.gz
gsoc2013-evolution-4a3c80cd3cc3beb41ecbdd9c7b7a9a489de4e009.tar.zst
gsoc2013-evolution-4a3c80cd3cc3beb41ecbdd9c7b7a9a489de4e009.zip
Add code to kludge around any x-inline-pgp-hacks by prepending some
2001-11-07 Jeffrey Stedfast <fejj@ximian.com> * camel-pgp-mime.c (camel_pgp_mime_part_decrypt): Add code to kludge around any x-inline-pgp-hacks by prepending some content headers to the decrypted data. svn path=/trunk/; revision=14620
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/camel-pgp-mime.c21
2 files changed, 27 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 3a2e167524..b7d0fadb2f 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-07 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-pgp-mime.c (camel_pgp_mime_part_decrypt): Add code to
+ kludge around any x-inline-pgp-hacks by prepending some content
+ headers to the decrypted data.
+
2001-11-02 Jeffrey Stedfast <fejj@ximian.com>
* camel-data-wrapper.c (camel_data_wrapper_init): Initialize our
diff --git a/camel/camel-pgp-mime.c b/camel/camel-pgp-mime.c
index 7f98ab4a44..bfc35f9f41 100644
--- a/camel/camel-pgp-mime.c
+++ b/camel/camel-pgp-mime.c
@@ -560,6 +560,27 @@ camel_pgp_mime_part_decrypt (CamelPgpContext *context, CamelMimePart *mime_part,
camel_object_unref (CAMEL_OBJECT (ciphertext));
camel_stream_reset (stream);
+ mime_type = camel_mime_part_get_content_type (mime_part);
+ if (header_content_type_param (mime_type, "x-inline-pgp-hack")) {
+ /* this is a kludge around inline pgp encryption - basically,
+ the multipart/encrypted is fake - the original encrypted
+ content is not really an encrypted mime part so after
+ decrypting it, we have to fake some mime content headers */
+ CamelStream *hack;
+
+ hack = camel_stream_mem_new ();
+
+#define CONTENT_TYPE_TEXT_PLAIN "Content-Type: text/plain\r\n\r\n"
+ camel_stream_write (hack, CONTENT_TYPE_TEXT_PLAIN,
+ sizeof (CONTENT_TYPE_TEXT_PLAIN) - 1);
+
+ camel_stream_write_to_stream (stream, hack);
+ camel_stream_reset (hack);
+
+ camel_object_unref (CAMEL_OBJECT (stream));
+ stream = hack;
+ }
+
/* construct the new decrypted mime part from the stream */
part = camel_mime_part_new ();