From 4823916613b56d2cf046469b466ef5c6754b8d27 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 1 Jun 2007 18:21:13 +0000 Subject: ** Fix for bug #315012 from Pascal Terjan svn path=/trunk/; revision=33611 --- composer/ChangeLog | 9 +++++++++ composer/e-msg-composer.c | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 39310f6e99..5bfb0e6035 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,12 @@ +2007-06-01 Srinivasa Ragavan + + ** Fix for bug #315012 from Pascal Terjan + + * e-msg-composer.c: (handle_multipart_signed), + (handle_multipart_encrypted), (handle_multipart_alternative), + (handle_multipart), (e_msg_composer_new_with_message): Pass mime part + instead of multipart to camel_cipher_decryp + 2007-04-19 Matthew Barnes ** Fixes part of bug #429422 diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 35120bdf05..57c6e4f40c 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -288,7 +288,7 @@ static void add_attachments_from_multipart (EMsgComposer *composer, CamelMultipa /* used by e_msg_composer_new_with_message() */ static void handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, int depth); static void handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart, int depth); -static void handle_multipart_encrypted (EMsgComposer *composer, CamelMultipart *multipart, int depth); +static void handle_multipart_encrypted (EMsgComposer *composer, CamelMimePart *multipart, int depth); static void handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, int depth); static void set_editor_signature (EMsgComposer *composer); @@ -4225,7 +4225,7 @@ handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, int handle_multipart_signed (composer, multipart, depth); } else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) { /* decrypt the encrypted content and configure the composer to encrypt outgoing messages */ - handle_multipart_encrypted (composer, multipart, depth); + handle_multipart_encrypted (composer, mime_part, depth); } else if (camel_content_type_is (content_type, "multipart", "alternative")) { /* this contains the text/plain and text/html versions of the message body */ handle_multipart_alternative (composer, multipart, depth); @@ -4245,7 +4245,7 @@ handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, int } static void -handle_multipart_encrypted (EMsgComposer *composer, CamelMultipart *multipart, int depth) +handle_multipart_encrypted (EMsgComposer *composer, CamelMimePart *multipart, int depth) { CamelContentType *content_type; CamelCipherContext *cipher; @@ -4260,7 +4260,7 @@ handle_multipart_encrypted (EMsgComposer *composer, CamelMultipart *multipart, i camel_exception_init (&ex); cipher = mail_crypto_get_pgp_cipher_context (NULL); mime_part = camel_mime_part_new(); - valid = camel_cipher_decrypt(cipher, (CamelMimePart *)multipart, mime_part, &ex); + valid = camel_cipher_decrypt(cipher, multipart, mime_part, &ex); camel_object_unref(cipher); camel_exception_clear (&ex); if (valid == NULL) @@ -4333,7 +4333,7 @@ handle_multipart_alternative (EMsgComposer *composer, CamelMultipart *multipart, handle_multipart_signed (composer, mp, depth + 1); } else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) { /* decrypt the encrypted content and configure the composer to encrypt outgoing messages */ - handle_multipart_encrypted (composer, mp, depth + 1); + handle_multipart_encrypted (composer, mime_part, depth + 1); } else { /* depth doesn't matter so long as we don't pass 0 */ handle_multipart (composer, mp, depth + 1); @@ -4387,7 +4387,7 @@ handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, int depth) handle_multipart_signed (composer, mp, depth + 1); } else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) { /* decrypt the encrypted content and configure the composer to encrypt outgoing messages */ - handle_multipart_encrypted (composer, mp, depth + 1); + handle_multipart_encrypted (composer, mime_part, depth + 1); } else if (camel_content_type_is (content_type, "multipart", "alternative")) { handle_multipart_alternative (composer, mp, depth + 1); } else { @@ -4685,7 +4685,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *message) handle_multipart_signed (new, multipart, 0); } else if (CAMEL_IS_MULTIPART_ENCRYPTED (content)) { /* decrypt the encrypted content and configure the composer to encrypt outgoing messages */ - handle_multipart_encrypted (new, multipart, 0); + handle_multipart_encrypted (new, message, 0); } else if (camel_content_type_is (content_type, "multipart", "alternative")) { /* this contains the text/plain and text/html versions of the message body */ handle_multipart_alternative (new, multipart, 0); -- cgit v1.2.3