diff options
Diffstat (limited to 'camel/camel-pgp-mime.c')
-rw-r--r-- | camel/camel-pgp-mime.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/camel/camel-pgp-mime.c b/camel/camel-pgp-mime.c index a9eef4e7cc..ba91804579 100644 --- a/camel/camel-pgp-mime.c +++ b/camel/camel-pgp-mime.c @@ -244,6 +244,20 @@ camel_pgp_mime_part_sign (CamelPgpContext *context, CamelMimePart **mime_part, c /* construct the signature stream */ sigstream = camel_stream_mem_new (); + switch (hash) { + case CAMEL_CIPHER_HASH_MD5: + hash_type = "pgp-md5"; + break; + case CAMEL_CIPHER_HASH_SHA1: + hash_type = "pgp-sha1"; + break; + default: + /* set a reasonable default */ + hash = CAMEL_CIPHER_HASH_SHA1; + hash_type = "pgp-sha1"; + break; + } + /* get the signature */ if (camel_pgp_sign (context, userid, hash, stream, sigstream, ex) == -1) { camel_object_unref (CAMEL_OBJECT (stream)); @@ -269,20 +283,6 @@ camel_pgp_mime_part_sign (CamelPgpContext *context, CamelMimePart **mime_part, c camel_object_unref (CAMEL_OBJECT (sigstream)); /* construct the container multipart/signed */ - switch (hash) { - case CAMEL_CIPHER_HASH_MD5: - hash_type = "pgp-md5"; - break; - case CAMEL_CIPHER_HASH_SHA1: - hash_type = "pgp-sha1"; - break; - default: - /* set a reasonable default */ - hash = CAMEL_CIPHER_HASH_SHA1; - hash_type = "pgp-sha1"; - break; - } - multipart = camel_multipart_new (); mime_type = header_content_type_new ("multipart", "signed"); |