From 632e29aba593f9036db5a6d9c7c8a5a76209793f Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 15 Oct 2002 20:09:18 +0000 Subject: If the hash id is NULL, return CAMEL_CIPHER_HASH_DEFAULT. Fixes bug 2002-10-15 Jeffrey Stedfast * camel-gpg-context.c (gpg_id_to_hash): If the hash id is NULL, return CAMEL_CIPHER_HASH_DEFAULT. Fixes bug #32229. svn path=/trunk/; revision=18371 --- camel/ChangeLog | 5 +++++ camel/camel-gpg-context.c | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'camel') 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 + + * 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 * 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; } -- cgit