From c90788513be116b6bcb9791807bd26866c1961b8 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 22 Jan 2001 22:55:11 +0000 Subject: Fixed to display subparts (other than the signature part) and started to 2001-01-22 Jeffrey Stedfast * mail-format.c (handle_multipart_signed): Fixed to display subparts (other than the signature part) and started to write a pretty way to show if the signature verified or not. svn path=/trunk/; revision=7724 --- mail/ChangeLog | 6 ++++++ mail/mail-format.c | 48 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 47 insertions(+), 7 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index a69dec671d..0f7f44d730 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2001-01-22 Jeffrey Stedfast + + * mail-format.c (handle_multipart_signed): Fixed to display + subparts (other than the signature part) and started to write a + pretty way to show if the signature verified or not. + 2001-01-23 Not Zed * mail-crypto.c (pgp_mime_part_verify): Fix a double-free problem. diff --git a/mail/mail-format.c b/mail/mail-format.c index 0651b71cd7..d058ec258f 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -1223,8 +1223,11 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type, MailDisplay *md) { CamelDataWrapper *wrapper; - CamelException ex; + CamelMultipart *mp; + CamelException *ex; + gboolean output = FALSE; gboolean valid; + int nparts, i; wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); g_return_val_if_fail (CAMEL_IS_MULTIPART (wrapper), FALSE); @@ -1233,15 +1236,46 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type, if (!mail_crypto_is_rfc2015_signed (part)) return handle_multipart_mixed (part, mime_type, md); - camel_exception_init (&ex); - valid = pgp_mime_part_verify (part, &ex); + ex = camel_exception_new (); + valid = pgp_mime_part_verify (part, ex); - if (camel_exception_is_set (&ex)) { - /* FIXME: maybe we should warn the user? */ - handle_multipart_mixed (part, mime_type, md); + /* now display all the subparts *except* the signature */ + mp = CAMEL_MULTIPART (wrapper); + + nparts = camel_multipart_get_number (mp); + for (i = 0; i < nparts - 1; i++) { + if (i != 0 && output) + mail_html_write (md->html, md->stream, "
\n"); + + part = camel_multipart_get_part (mp, i); + + output = call_handler_function (part, md); + } + + /* Now display the "seal-of-authenticity" or something... */ +#if 0 + if (valid) { + mail_html_write (md->html, md->stream, + "" + "" + "
%s

", + get_url_for_icon ("wax-seal2.png", md), + _("This message is digitally signed and " + "has been found to be authentic.")); + } else { + mail_html_write (md->html, md->stream, + "" + "
", + get_url_for_icon ("wax-seal-broken.png", md)); + mail_error_write (md->html, md->stream, + camel_exception_get_description (ex)); + mail_html_write (md->html, md->stream, + "

"); } +#endif + camel_exception_free (ex); - return valid; + return TRUE; } /* As seen in RFC 2387! */ -- cgit