aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-cipher-context.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 269e29bdc4..c4b0a513ab 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-14 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-cipher-context.c: Check to make sure the context is a
+ valid context in all the user functions.
+
2001-04-13 Jon Trowbridge <trow@ximian.com>
* providers/imap/camel-imap-store.c (imap_disconnect):
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);