diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-10-23 05:50:21 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-10-23 05:50:21 +0800 |
commit | b80a058e5534b668e11d7e6b31408acf52bf4bd3 (patch) | |
tree | b5e7e5d1ee7b4cc884dd263d7ea58797cfffa4c9 /camel | |
parent | 739e7cd1da237df90e26d979101c3624aef4a779 (diff) | |
download | gsoc2013-evolution-b80a058e5534b668e11d7e6b31408acf52bf4bd3.tar.gz 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')
-rw-r--r-- | camel/ChangeLog | 6 | ||||
-rw-r--r-- | camel/camel-pgp-context.c | 2 | ||||
-rw-r--r-- | camel/camel-pgp-mime.c | 26 |
3 files changed, 30 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 4358626ed6..06e5e748bb 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +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. + 2001-10-22 <NotZed@Ximian.com> * camel-filter-search.c, camel-folder-search.c (check_header): Use diff --git a/camel/camel-pgp-context.c b/camel/camel-pgp-context.c index 79a53fd633..20d35d1a7b 100644 --- a/camel/camel-pgp-context.c +++ b/camel/camel-pgp-context.c @@ -1027,7 +1027,7 @@ pgp_verify (CamelCipherContext *ctx, CamelCipherHash hash, CamelStream *istream, desc = outbuf = g_new (unsigned char, outlen + 1); - locale = e_iconv_locale_charset(); + locale = e_iconv_locale_charset (); if (!locale) locale = "iso-8859-1"; 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)); |