aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-pgp-mime.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-10-23 05:50:21 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-10-23 05:50:21 +0800
commitb80a058e5534b668e11d7e6b31408acf52bf4bd3 (patch)
treeb5e7e5d1ee7b4cc884dd263d7ea58797cfffa4c9 /camel/camel-pgp-mime.c
parent739e7cd1da237df90e26d979101c3624aef4a779 (diff)
downloadgsoc2013-evolution-b80a058e5534b668e11d7e6b31408acf52bf4bd3.tar
gsoc2013-evolution-b80a058e5534b668e11d7e6b31408acf52bf4bd3.tar.gz
gsoc2013-evolution-b80a058e5534b668e11d7e6b31408acf52bf4bd3.tar.bz2
gsoc2013-evolution-b80a058e5534b668e11d7e6b31408acf52bf4bd3.tar.lz
gsoc2013-evolution-b80a058e5534b668e11d7e6b31408acf52bf4bd3.tar.xz
gsoc2013-evolution-b80a058e5534b668e11d7e6b31408acf52bf4bd3.tar.zst
gsoc2013-evolution-b80a058e5534b668e11d7e6b31408acf52bf4bd3.zip
If we are kludging around a inline-pgp signed part, do some charset
2001-10-22 Jeffrey Stedfast <fejj@ximian.com> * camel-pgp-mime.c (camel_pgp_mime_part_verify): If we are kludging around a inline-pgp signed part, do some charset conversion to protect any 8bit text. svn path=/trunk/; revision=13896
Diffstat (limited to 'camel/camel-pgp-mime.c')
-rw-r--r--camel/camel-pgp-mime.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/camel/camel-pgp-mime.c b/camel/camel-pgp-mime.c
index 37b7cb1b58..b63f5af07e 100644
--- a/camel/camel-pgp-mime.c
+++ b/camel/camel-pgp-mime.c
@@ -29,6 +29,7 @@
#include "camel-mime-message.h"
#include "camel-mime-filter-from.h"
#include "camel-mime-filter-crlf.h"
+#include "camel-mime-filter-charset.h"
#include "camel-stream-filter.h"
#include "camel-stream-mem.h"
#include "camel-stream-fs.h"
@@ -373,11 +374,30 @@ camel_pgp_mime_part_verify (CamelPgpContext *context, CamelMimePart *mime_part,
camel_object_unref (CAMEL_OBJECT (crlf_filter));
camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (from_filter));
camel_object_unref (CAMEL_OBJECT (from_filter));
-
+
type = camel_mime_part_get_content_type (mime_part);
- if (header_content_type_param (type, "x-inline-pgp-hack"))
+ if (header_content_type_param (type, "x-inline-pgp-hack")) {
+ /* this is a kludge around inline pgp signatures - basically,
+ the multipart/signed is faked - the original part (aka part #1)
+ is the original mime part and the signature is a copy of the
+ signature in part #1 */
+ CamelMimeFilterCharset *charset_filter;
+ CamelContentType *content_type;
+ const char *charset;
+
+ content_type = camel_mime_part_get_content_type (part);
+ charset = header_content_type_param (content_type, "charset");
+ if (charset) {
+ charset_filter = camel_mime_filter_charset_new_convert ("utf-8", charset);
+ if (charset_filter) {
+ camel_stream_filter_add (filtered_stream,
+ CAMEL_MIME_FILTER (charset_filter));
+ camel_object_unref (CAMEL_OBJECT (charset_filter));
+ }
+ }
+
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
- else
+ } else
wrapper = CAMEL_DATA_WRAPPER (part);
camel_data_wrapper_write_to_stream (wrapper, CAMEL_STREAM (filtered_stream));
camel_object_unref (CAMEL_OBJECT (filtered_stream));