aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-cipher-context.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-cipher-context.c')
-rw-r--r--camel/camel-cipher-context.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c
index 1f6f4af3ec..dde023eb10 100644
--- a/camel/camel-cipher-context.c
+++ b/camel/camel-cipher-context.c
@@ -189,6 +189,8 @@ camel_cipher_sign (CamelCipherContext *context, const char *userid, CamelCipherH
{
int retval;
+ g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
+
CIPHER_LOCK(context);
retval = CCC_CLASS (context)->sign (context, userid, hash, istream, ostream, ex);
@@ -227,6 +229,8 @@ camel_cipher_clearsign (CamelCipherContext *context, const char *userid, CamelCi
{
int retval;
+ g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
+
CIPHER_LOCK(context);
retval = CCC_CLASS (context)->clearsign (context, userid, hash, istream, ostream, ex);
@@ -268,6 +272,8 @@ camel_cipher_verify (CamelCipherContext *context, CamelStream *istream,
{
CamelCipherValidity *valid;
+ g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), NULL);
+
CIPHER_LOCK(context);
valid = CCC_CLASS (context)->verify (context, istream, sigstream, ex);
@@ -308,6 +314,8 @@ camel_cipher_encrypt (CamelCipherContext *context, gboolean sign, const char *us
{
int retval;
+ g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
+
CIPHER_LOCK(context);
retval = CCC_CLASS (context)->encrypt (context, sign, userid, recipients, istream, ostream, ex);
@@ -345,6 +353,8 @@ camel_cipher_decrypt (CamelCipherContext *context, CamelStream *istream,
{
int retval;
+ g_return_val_if_fail (CAMEL_IS_CIPHER_CONTEXT (context), -1);
+
CIPHER_LOCK(context);
retval = CCC_CLASS (context)->decrypt (context, istream, ostream, ex);