aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-pgp-mime.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-09-28 06:32:11 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-09-28 06:32:11 +0800
commita0c093ed244b8187e8f1eed40ed3598493468741 (patch)
treea7ddc2877f465e196db368c764d084f43cd7d21c /camel/camel-pgp-mime.c
parent7511816ec5a6f67e08d0dd4701754af8cf4b5145 (diff)
downloadgsoc2013-evolution-a0c093ed244b8187e8f1eed40ed3598493468741.tar
gsoc2013-evolution-a0c093ed244b8187e8f1eed40ed3598493468741.tar.gz
gsoc2013-evolution-a0c093ed244b8187e8f1eed40ed3598493468741.tar.bz2
gsoc2013-evolution-a0c093ed244b8187e8f1eed40ed3598493468741.tar.lz
gsoc2013-evolution-a0c093ed244b8187e8f1eed40ed3598493468741.tar.xz
gsoc2013-evolution-a0c093ed244b8187e8f1eed40ed3598493468741.tar.zst
gsoc2013-evolution-a0c093ed244b8187e8f1eed40ed3598493468741.zip
CRLF decode the stream before parsing it into a MIME part. This fixes bug
2001-09-27 Jeffrey Stedfast <fejj@ximian.com> * camel-pgp-mime.c (camel_pgp_mime_part_decrypt): CRLF decode the stream before parsing it into a MIME part. This fixes bug #10521. * camel-store.c: Remove the old folder from the vTrash folder. svn path=/trunk/; revision=13199
Diffstat (limited to 'camel/camel-pgp-mime.c')
-rw-r--r--camel/camel-pgp-mime.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/camel/camel-pgp-mime.c b/camel/camel-pgp-mime.c
index 149e1baf3b..fb17256528 100644
--- a/camel/camel-pgp-mime.c
+++ b/camel/camel-pgp-mime.c
@@ -31,11 +31,14 @@
#include "camel-mime-filter-crlf.h"
#include "camel-stream-filter.h"
#include "camel-stream-mem.h"
+#include "camel-stream-fs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#define PGPMIME_DEBUG
+
#define d(x) x
/** rfc2015 stuff (aka PGP/MIME) *******************************/
@@ -495,6 +498,8 @@ camel_pgp_mime_part_decrypt (CamelPgpContext *context, CamelMimePart *mime_part,
CamelMimePart *encrypted_part, *part;
CamelContentType *mime_type;
CamelStream *stream, *ciphertext;
+ CamelStreamFilter *filtered_stream;
+ CamelMimeFilter *crlf_filter;
g_return_val_if_fail (mime_part != NULL, NULL);
g_return_val_if_fail (CAMEL_IS_MIME_PART (mime_part), NULL);
@@ -530,8 +535,17 @@ camel_pgp_mime_part_decrypt (CamelPgpContext *context, CamelMimePart *mime_part,
/* construct the new decrypted mime part from the stream */
part = camel_mime_part_new ();
- camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (part), stream);
+
+ crlf_filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE,
+ CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY);
+ filtered_stream = camel_stream_filter_new_with_stream (stream);
camel_object_unref (CAMEL_OBJECT (stream));
+ camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (crlf_filter));
+ camel_object_unref (CAMEL_OBJECT (crlf_filter));
+
+ camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (part), CAMEL_STREAM (filtered_stream));
+
+ camel_object_unref (CAMEL_OBJECT (filtered_stream));
return part;
}