diff options
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-format.c | 48 |
2 files changed, 47 insertions, 7 deletions
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 <fejj@ximian.com> + + * 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 <NotZed@Ximian.com> * 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, "<hr>\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, + "<table><tr valign=top>" + "<td><img src=\"%s\"></td>" + "<td>%s<br><br></td></table>", + 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, + "<table><tr valign=top>" + "<td><img src=\"%s\"></td><td>", + 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, + "<br><br></td></table>"); } +#endif + camel_exception_free (ex); - return valid; + return TRUE; } /* As seen in RFC 2387! */ |