aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-01-23 06:55:11 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-23 06:55:11 +0800
commitc90788513be116b6bcb9791807bd26866c1961b8 (patch)
tree358988c73a7f32687a4b779789e6af547993de61
parentcdf4ac3653a47da1f9566e33f9dc7abbfeb79299 (diff)
downloadgsoc2013-evolution-c90788513be116b6bcb9791807bd26866c1961b8.tar.gz
gsoc2013-evolution-c90788513be116b6bcb9791807bd26866c1961b8.tar.zst
gsoc2013-evolution-c90788513be116b6bcb9791807bd26866c1961b8.zip
Fixed to display subparts (other than the signature part) and started to
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. svn path=/trunk/; revision=7724
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-format.c48
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! */