diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-11-10 01:10:26 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-11-10 01:10:26 +0800 |
commit | eebf9be69590771ec04c254ec6391237dee3622c (patch) | |
tree | 570fc27a007d05cba2246a094834d0ef46a4dc06 | |
parent | df5bede1f424f7829ddee0ec3d93e0bc47283c75 (diff) | |
download | gsoc2013-evolution-eebf9be69590771ec04c254ec6391237dee3622c.tar.gz gsoc2013-evolution-eebf9be69590771ec04c254ec6391237dee3622c.tar.zst gsoc2013-evolution-eebf9be69590771ec04c254ec6391237dee3622c.zip |
Fix for bug #69241.
2004-11-08 Jeffrey Stedfast <fejj@novell.com>
Fix for bug #69241.
* camel-gpg-context.c (gpg_decrypt): We need to extract just the
application/pgp-encrypted part from the multipart/encrypted that
gets passed in. Added checks to verify that the input part is the
correct type as well. Once we have the application/pgp-encrypted
part, we need to use camel_data_wrapper_decode_to_stream() in case
the part was encoded in any way.
svn path=/trunk/; revision=27876
-rw-r--r-- | camel/ChangeLog | 11 | ||||
-rw-r--r-- | camel/camel-gpg-context.c | 26 |
2 files changed, 27 insertions, 10 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index f343b0439b..ab9a878995 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,14 @@ +2004-11-08 Jeffrey Stedfast <fejj@novell.com> + + Fix for bug #69241. + + * camel-gpg-context.c (gpg_decrypt): We need to extract just the + application/pgp-encrypted part from the multipart/encrypted that + gets passed in. Added checks to verify that the input part is the + correct type as well. Once we have the application/pgp-encrypted + part, we need to use camel_data_wrapper_decode_to_stream() in case + the part was encoded in any way. + 2004-11-09 Jeffrey Stedfast <fejj@novell.com> * providers/imap4/camel-imap4-stream.c (camel_imap4_stream_line): diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c index 5dee244fd4..37c354b923 100644 --- a/camel/camel-gpg-context.c +++ b/camel/camel-gpg-context.c @@ -1665,18 +1665,24 @@ gpg_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *op struct _GpgCtx *gpg; CamelCipherValidity *valid = NULL; CamelStream *ostream, *istream; - + CamelDataWrapper *content; + CamelMimePart *encrypted; + CamelContentType *ct; + const char *protocol; + CamelMultipart *mp; + + mp = (CamelMultipart *) camel_medium_get_content_object ((CamelMedium *) ipart); + if (!(encrypted = camel_multipart_get_part (mp, CAMEL_MULTIPART_ENCRYPTED_CONTENT))) { + camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to decrypt MIME part: protocol error")); + return NULL; + } + + content = camel_medium_get_content_object ((CamelMedium *) encrypted); + istream = camel_stream_mem_new(); - camel_data_wrapper_write_to_stream(camel_medium_get_content_object((CamelMedium *)ipart), istream); + camel_data_wrapper_decode_to_stream (content, istream); camel_stream_reset(istream); - - /* TODO: de-canonicalise end of lines? */ - /*stream = camel_stream_mem_new (); - filtered_stream = (CamelStream *) camel_stream_filter_new_with_stream (stream); - crlf_filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, - CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY); - camel_stream_filter_add (CAMEL_STREAM_FILTER (filtered_stream), crlf_filter); - camel_object_unref (crlf_filter);*/ + ostream = camel_stream_mem_new(); camel_stream_mem_set_secure((CamelStreamMem *)ostream); |