aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-crypto.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-04-15 05:24:07 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-04-15 05:24:07 +0800
commit4e3776a37dee9b520e9ec71a051dc7f3ceb836bd (patch)
treed5b704f9fa823a9bf80b777fc82538df437ea325 /mail/mail-crypto.c
parent6dce8c2f32c5738b78a6e7b26e15db8b562981e5 (diff)
downloadgsoc2013-evolution-4e3776a37dee9b520e9ec71a051dc7f3ceb836bd.tar.gz
gsoc2013-evolution-4e3776a37dee9b520e9ec71a051dc7f3ceb836bd.tar.zst
gsoc2013-evolution-4e3776a37dee9b520e9ec71a051dc7f3ceb836bd.zip
Only use non-NULL contexts. (mail_crypto_pgp_mime_part_encrypt): Same.
2001-04-14 Jeffrey Stedfast <fejj@ximian.com> * mail-crypto.c (mail_crypto_pgp_mime_part_verify): Only use non-NULL contexts. (mail_crypto_pgp_mime_part_encrypt): Same. (mail_crypto_pgp_mime_part_decrypt): And here too. * mail-format.c (try_inline_pgp_sig): Make sure to not use the context if it is NULL. (decode_pgp): Same. * folder-browser-factory.c: Added stuff for filtering/vfoldering on mailinglists. svn path=/trunk/; revision=9315
Diffstat (limited to 'mail/mail-crypto.c')
-rw-r--r--mail/mail-crypto.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/mail/mail-crypto.c b/mail/mail-crypto.c
index 7613f11eef..7fb3aba88d 100644
--- a/mail/mail-crypto.c
+++ b/mail/mail-crypto.c
@@ -154,13 +154,16 @@ mail_crypto_pgp_mime_part_sign (CamelMimePart **mime_part, const char *userid, C
CamelCipherValidity *
mail_crypto_pgp_mime_part_verify (CamelMimePart *mime_part, CamelException *ex)
{
+ CamelCipherValidity *valid = NULL;
CamelPgpContext *context;
- CamelCipherValidity *valid;
context = camel_pgp_context_new (session, mail_config_get_pgp_type (),
mail_config_get_pgp_path ());
- valid = camel_pgp_mime_part_verify (context, mime_part, ex);
- camel_object_unref (CAMEL_OBJECT (context));
+
+ if (context) {
+ valid = camel_pgp_mime_part_verify (context, mime_part, ex);
+ camel_object_unref (CAMEL_OBJECT (context));
+ }
return valid;
}
@@ -183,8 +186,11 @@ mail_crypto_pgp_mime_part_encrypt (CamelMimePart **mime_part, GPtrArray *recipie
context = camel_pgp_context_new (session, mail_config_get_pgp_type (),
mail_config_get_pgp_path ());
- camel_pgp_mime_part_encrypt (context, mime_part, recipients, ex);
- camel_object_unref (CAMEL_OBJECT (context));
+
+ if (context) {
+ camel_pgp_mime_part_encrypt (context, mime_part, recipients, ex);
+ camel_object_unref (CAMEL_OBJECT (context));
+ }
}
@@ -199,12 +205,15 @@ CamelMimePart *
mail_crypto_pgp_mime_part_decrypt (CamelMimePart *mime_part, CamelException *ex)
{
CamelPgpContext *context;
- CamelMimePart *part;
+ CamelMimePart *part = NULL;
context = camel_pgp_context_new (session, mail_config_get_pgp_type (),
mail_config_get_pgp_path ());
- part = camel_pgp_mime_part_decrypt (context, mime_part, ex);
- camel_object_unref (CAMEL_OBJECT (context));
+
+ if (context) {
+ part = camel_pgp_mime_part_decrypt (context, mime_part, ex);
+ camel_object_unref (CAMEL_OBJECT (context));
+ }
return part;
}