aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-10-30 13:03:28 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-10-30 13:03:28 +0800
commit8747a6919fbd4e318cceb8638f01d6f37e2d82f1 (patch)
tree50fb3b593a8669e43f90f9ed0a6d512c814d68d9 /mail/em-format-html.c
parent066508d8f64ccb2d9da7a288800e82db6ff53e40 (diff)
downloadgsoc2013-evolution-8747a6919fbd4e318cceb8638f01d6f37e2d82f1.tar.gz
gsoc2013-evolution-8747a6919fbd4e318cceb8638f01d6f37e2d82f1.tar.zst
gsoc2013-evolution-8747a6919fbd4e318cceb8638f01d6f37e2d82f1.zip
show application/x-pkcs7-mime inline always by default.
2003-10-30 Not Zed <NotZed@Ximian.com> * em-format.c (em_format_is_inline): show application/x-pkcs7-mime inline always by default. 2003-10-30 Not Zed <NotZed@Ximian.com> * em-format.c (emf_multipart_signed): handle application/x-pkcs7-signature. 2003-10-29 Not Zed <NotZed@Ximian.com> * em-format-html.c (em_format_html_multipart_signed_sign): handle application/x-pkcs7-signature. * em-format.c (emf_application_xpkcs7mime): Handle application/x-pkcs7-mime. svn path=/trunk/; revision=23129
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r--mail/em-format-html.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index f95624e655..09f45d8ceb 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -53,6 +53,7 @@
#include <camel/camel-multipart.h>
#include <camel/camel-multipart-signed.h>
#include <camel/camel-gpg-context.h>
+#include <camel/camel-smime-context.h>
#include <camel/camel-stream-mem.h>
#include <camel/camel-url.h>
#include <camel/camel-stream-fs.h>
@@ -61,6 +62,7 @@
#include <camel/camel-data-cache.h>
#include <camel/camel-file-utils.h>
+
#include <e-util/e-msgport.h>
#include "mail-component.h"
@@ -913,29 +915,41 @@ em_format_html_multipart_signed_sign(EMFormat *emf, CamelStream *stream, CamelMi
CamelException ex;
const char *message = NULL;
int good = 0;
- CamelCipherContext *cipher;
char *classid;
EMFormatPURI *iconpuri;
CamelMimePart *iconpart;
static int iconid;
mps = (CamelMultipartSigned *)camel_medium_get_content_object((CamelMedium *)part);
+
+ /* FIXME: This sequence is also copied in em-format-html.c */
+
spart = camel_multipart_get_part((CamelMultipart *)mps, CAMEL_MULTIPART_SIGNED_SIGNATURE);
camel_exception_init(&ex);
if (spart == NULL) {
message = _("No signature present");
} else if (emf->session == NULL) {
message = _("Session not initialised");
- } else if ((cipher = camel_gpg_context_new(emf->session)) == NULL) {
- message = _("Could not create signature verfication context");
} else {
- valid = camel_multipart_signed_verify(mps, cipher, &ex);
- camel_object_unref(cipher);
- if (valid) {
- good = camel_cipher_validity_get_valid(valid)?1:0;
- message = camel_cipher_validity_get_description(valid);
+ CamelCipherContext *cipher = NULL;
+
+ /* FIXME: Should be done via a plugin interface */
+ if (g_ascii_strcasecmp("application/x-pkcs7-signature", mps->protocol) == 0)
+ cipher = camel_smime_context_new(emf->session);
+ else if (g_ascii_strcasecmp("application/pgp-signature", mps->protocol) == 0)
+ cipher = camel_gpg_context_new(emf->session);
+
+ if (cipher == NULL) {
+ message = _("Unsupported signature format");
} else {
- message = camel_exception_get_description(&ex);
+ valid = camel_multipart_signed_verify(mps, cipher, &ex);
+ camel_object_unref(cipher);
+ if (valid) {
+ good = camel_cipher_validity_get_valid(valid)?1:0;
+ message = camel_cipher_validity_get_description(valid);
+ } else {
+ message = camel_exception_get_description(&ex);
+ }
}
}