diff options
author | Not Zed <NotZed@Ximian.com> | 2002-05-31 08:55:55 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-05-31 08:55:55 +0800 |
commit | 29a8c80e9323ef2406c2b237a6a6058639fd4cb2 (patch) | |
tree | 65b2d70063dfc6af044172b7a9d92218dd19b4a0 | |
parent | 9c95fa77bfca0807a1dc5e25b39173d21cb80b24 (diff) | |
download | gsoc2013-evolution-29a8c80e9323ef2406c2b237a6a6058639fd4cb2.tar gsoc2013-evolution-29a8c80e9323ef2406c2b237a6a6058639fd4cb2.tar.gz gsoc2013-evolution-29a8c80e9323ef2406c2b237a6a6058639fd4cb2.tar.bz2 gsoc2013-evolution-29a8c80e9323ef2406c2b237a6a6058639fd4cb2.tar.lz gsoc2013-evolution-29a8c80e9323ef2406c2b237a6a6058639fd4cb2.tar.xz gsoc2013-evolution-29a8c80e9323ef2406c2b237a6a6058639fd4cb2.tar.zst gsoc2013-evolution-29a8c80e9323ef2406c2b237a6a6058639fd4cb2.zip |
Changes for multipart/signed api changes.
2002-05-30 Not Zed <NotZed@Ximian.com>
* e-msg-composer.c (build_message): Changes for multipart/signed api changes.
svn path=/trunk/; revision=17056
-rw-r--r-- | composer/ChangeLog | 4 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 22 |
2 files changed, 20 insertions, 6 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index ec42f9287a..09c28c429a 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,7 @@ +2002-05-30 Not Zed <NotZed@Ximian.com> + + * e-msg-composer.c (build_message): Changes for multipart/signed api changes. + 2002-05-16 Ettore Perazzoli <ettore@ximian.com> * e-msg-composer.c: New local `all_composers'; keeps a list of all diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 368797a2ad..8df40f7064 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -86,6 +86,7 @@ #include "camel/camel.h" #include "camel/camel-charset-map.h" #include "camel/camel-session.h" +#include "camel/camel-multipart-signed.h" #include "mail/mail.h" #include "mail/mail-crypto.h" @@ -492,7 +493,9 @@ build_message (EMsgComposer *composer) if (composer->pgp_sign) { CamelInternetAddress *from = NULL; const char *pgpid; - + CamelMultipartSigned *mps; + CamelCipherContext *context; + camel_exception_init (&ex); if (hdrs->account && hdrs->account->pgp_key && *hdrs->account->pgp_key) { @@ -503,17 +506,24 @@ build_message (EMsgComposer *composer) camel_internet_address_get (from, 0, NULL, &pgpid); } - printf ("build_message(): pgpid = '%s'\n", pgpid); - - mail_crypto_pgp_mime_part_sign (&part, pgpid, CAMEL_CIPHER_HASH_SHA1, &ex); - + context = (CamelCipherContext *)camel_pgp_context_new(session, mail_config_get_pgp_type(), mail_config_get_pgp_path()); + if (context == NULL) { + camel_exception_setv(&ex, 1, _("Could not create a PGP signature context")); + goto exception; + } + mps = camel_multipart_signed_new(); + camel_multipart_signed_sign(mps, context, part, pgpid, CAMEL_CIPHER_HASH_SHA1, &ex); + camel_medium_set_content_object(CAMEL_MEDIUM (part), (CamelDataWrapper *)mps); + camel_object_unref((CamelObject *)mps); + camel_object_unref((CamelObject *)context); + if (from) camel_object_unref (CAMEL_OBJECT (from)); if (camel_exception_is_set (&ex)) goto exception; } - + if (composer->pgp_encrypt) { /* FIXME: recipients should be an array of key ids rather than email addresses */ const CamelInternetAddress *addr; |