aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-gpg-context.c18
2 files changed, 15 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 8e240f1409..4b88d89361 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-15 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-gpg-context.c (gpg_id_to_hash): If the hash id is NULL,
+ return CAMEL_CIPHER_HASH_DEFAULT. Fixes bug #32229.
+
2002-10-08 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-command.c (imap_read_response): If the
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index 9b586e5f9b..e994c1054c 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -191,14 +191,16 @@ gpg_hash_to_id (CamelCipherContext *context, CamelCipherHash hash)
static CamelCipherHash
gpg_id_to_hash (CamelCipherContext *context, const char *id)
{
- if (!strcmp (id, "pgp-md2"))
- return CAMEL_CIPHER_HASH_MD2;
- else if (!strcmp (id, "pgp-md5"))
- return CAMEL_CIPHER_HASH_MD5;
- else if (!strcmp (id, "pgp-sha1"))
- return CAMEL_CIPHER_HASH_SHA1;
- else if (!strcmp (id, "pgp-ripemd160"))
- return CAMEL_CIPHER_HASH_RIPEMD160;
+ if (id) {
+ if (!strcmp (id, "pgp-md2"))
+ return CAMEL_CIPHER_HASH_MD2;
+ else if (!strcmp (id, "pgp-md5"))
+ return CAMEL_CIPHER_HASH_MD5;
+ else if (!strcmp (id, "pgp-sha1"))
+ return CAMEL_CIPHER_HASH_SHA1;
+ else if (!strcmp (id, "pgp-ripemd160"))
+ return CAMEL_CIPHER_HASH_RIPEMD160;
+ }
return CAMEL_CIPHER_HASH_DEFAULT;
}