|
|
c2160b |
diff -up evolution-3.28.5/src/em-format/e-mail-formatter-utils.c.cve-2018-15587-reposition-signature-bar evolution-3.28.5/src/em-format/e-mail-formatter-utils.c
|
|
|
c2160b |
--- evolution-3.28.5/src/em-format/e-mail-formatter-utils.c.cve-2018-15587-reposition-signature-bar 2018-07-30 15:37:05.000000000 +0200
|
|
|
c2160b |
+++ evolution-3.28.5/src/em-format/e-mail-formatter-utils.c 2019-10-24 16:21:32.730944332 +0200
|
|
|
c2160b |
@@ -549,71 +549,136 @@ e_mail_formatter_format_security_header
|
|
|
c2160b |
EMailPart *part,
|
|
|
c2160b |
guint32 flags)
|
|
|
c2160b |
{
|
|
|
c2160b |
- const gchar* part_id;
|
|
|
c2160b |
- gchar* part_id_prefix;
|
|
|
c2160b |
- GString* tmp;
|
|
|
c2160b |
+ struct _validity_flags {
|
|
|
c2160b |
+ guint32 flags;
|
|
|
c2160b |
+ const gchar *description_complete;
|
|
|
c2160b |
+ const gchar *description_partial;
|
|
|
c2160b |
+ } validity_flags[] = {
|
|
|
c2160b |
+ { E_MAIL_PART_VALIDITY_PGP | E_MAIL_PART_VALIDITY_SIGNED, N_("GPG signed"), N_("partially GPG signed") },
|
|
|
c2160b |
+ { E_MAIL_PART_VALIDITY_PGP | E_MAIL_PART_VALIDITY_ENCRYPTED, N_("GPG encrypted"), N_("partially GPG encrypted") },
|
|
|
c2160b |
+ { E_MAIL_PART_VALIDITY_SMIME | E_MAIL_PART_VALIDITY_SIGNED, N_("S/MIME signed"), N_("partially S/MIME signed") },
|
|
|
c2160b |
+ { E_MAIL_PART_VALIDITY_SMIME | E_MAIL_PART_VALIDITY_ENCRYPTED, N_("S/MIME encrypted"), N_("partially S/MIME encrypted") }
|
|
|
c2160b |
+ };
|
|
|
c2160b |
+ const gchar *part_id;
|
|
|
c2160b |
+ gchar *part_id_prefix;
|
|
|
c2160b |
GQueue queue = G_QUEUE_INIT;
|
|
|
c2160b |
GList *head, *link;
|
|
|
c2160b |
+ guint32 check_valid_flags = 0;
|
|
|
c2160b |
+ gint part_id_prefix_len;
|
|
|
c2160b |
+ gboolean is_partial = FALSE;
|
|
|
c2160b |
+ guint ii;
|
|
|
c2160b |
|
|
|
c2160b |
g_return_if_fail (E_IS_MAIL_PART_HEADERS (part));
|
|
|
c2160b |
|
|
|
c2160b |
/* Get prefix of this PURI */
|
|
|
c2160b |
part_id = e_mail_part_get_id (part);
|
|
|
c2160b |
part_id_prefix = g_strndup (part_id, g_strrstr (part_id, ".") - part_id);
|
|
|
c2160b |
-
|
|
|
c2160b |
- /* Add encryption/signature header */
|
|
|
c2160b |
- tmp = g_string_new ("");
|
|
|
c2160b |
+ part_id_prefix_len = strlen (part_id_prefix);
|
|
|
c2160b |
|
|
|
c2160b |
e_mail_part_list_queue_parts (context->part_list, NULL, &queue);
|
|
|
c2160b |
|
|
|
c2160b |
head = g_queue_peek_head_link (&queue);
|
|
|
c2160b |
|
|
|
c2160b |
- /* Find first secured part. */
|
|
|
c2160b |
- for (link = head; link != NULL; link = g_list_next(link)) {
|
|
|
c2160b |
+ /* Ignore the main message, the headers and the end parts */
|
|
|
c2160b |
+ #define should_skip_part(_id) \
|
|
|
c2160b |
+ (g_strcmp0 (_id, part_id_prefix) == 0 || \
|
|
|
c2160b |
+ (_id && g_str_has_suffix (_id, ".rfc822.end")) || \
|
|
|
c2160b |
+ (_id && strlen (_id) == part_id_prefix_len + 8 /* strlen (".headers") */ && \
|
|
|
c2160b |
+ g_strcmp0 (_id + part_id_prefix_len, ".headers") == 0))
|
|
|
c2160b |
+
|
|
|
c2160b |
+ /* Check parts for this ID. */
|
|
|
c2160b |
+ for (link = head; link != NULL; link = g_list_next (link)) {
|
|
|
c2160b |
EMailPart *mail_part = link->data;
|
|
|
c2160b |
+ const gchar *id = e_mail_part_get_id (mail_part);
|
|
|
c2160b |
|
|
|
c2160b |
- if (!e_mail_part_has_validity (mail_part))
|
|
|
c2160b |
+ if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix))
|
|
|
c2160b |
continue;
|
|
|
c2160b |
|
|
|
c2160b |
- if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix))
|
|
|
c2160b |
+ if (should_skip_part (id))
|
|
|
c2160b |
continue;
|
|
|
c2160b |
|
|
|
c2160b |
- if (e_mail_part_get_validity (mail_part, E_MAIL_PART_VALIDITY_PGP | E_MAIL_PART_VALIDITY_SIGNED)) {
|
|
|
c2160b |
- g_string_append (tmp, _("GPG signed"));
|
|
|
c2160b |
+ if (!e_mail_part_has_validity (mail_part)) {
|
|
|
c2160b |
+ /* A part without validity, thus it's partially signed/encrypted */
|
|
|
c2160b |
+ is_partial = TRUE;
|
|
|
c2160b |
+ } else {
|
|
|
c2160b |
+ guint32 validies = 0;
|
|
|
c2160b |
+ for (ii = 0; ii < G_N_ELEMENTS (validity_flags); ii++) {
|
|
|
c2160b |
+ if (e_mail_part_get_validity (mail_part, validity_flags[ii].flags))
|
|
|
c2160b |
+ validies |= validity_flags[ii].flags;
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+ check_valid_flags |= validies;
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
- if (e_mail_part_get_validity (mail_part, E_MAIL_PART_VALIDITY_PGP | E_MAIL_PART_VALIDITY_ENCRYPTED)) {
|
|
|
c2160b |
- if (tmp->len > 0)
|
|
|
c2160b |
- g_string_append (tmp, ", ");
|
|
|
c2160b |
- g_string_append (tmp, _("GPG encrypted"));
|
|
|
c2160b |
- }
|
|
|
c2160b |
+ /* Do not traverse sub-messages */
|
|
|
c2160b |
+ if (g_str_has_suffix (e_mail_part_get_id (mail_part), ".rfc822") &&
|
|
|
c2160b |
+ !g_str_equal (e_mail_part_get_id (mail_part), part_id_prefix))
|
|
|
c2160b |
+ link = e_mail_formatter_find_rfc822_end_iter (link);
|
|
|
c2160b |
+ }
|
|
|
c2160b |
|
|
|
c2160b |
- if (e_mail_part_get_validity (mail_part, E_MAIL_PART_VALIDITY_SMIME | E_MAIL_PART_VALIDITY_SIGNED)) {
|
|
|
c2160b |
- if (tmp->len > 0)
|
|
|
c2160b |
- g_string_append (tmp, ", ");
|
|
|
c2160b |
- g_string_append (tmp, _("S/MIME signed"));
|
|
|
c2160b |
+ if (check_valid_flags) {
|
|
|
c2160b |
+ GString *tmp;
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (!is_partial) {
|
|
|
c2160b |
+ for (link = head; link != NULL && !is_partial; link = g_list_next (link)) {
|
|
|
c2160b |
+ EMailPart *mail_part = link->data;
|
|
|
c2160b |
+ const gchar *id = e_mail_part_get_id (mail_part);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (!e_mail_part_id_has_prefix (mail_part, part_id_prefix))
|
|
|
c2160b |
+ continue;
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (should_skip_part (id))
|
|
|
c2160b |
+ continue;
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (!e_mail_part_has_validity (mail_part)) {
|
|
|
c2160b |
+ /* A part without validity, thus it's partially signed/encrypted */
|
|
|
c2160b |
+ is_partial = TRUE;
|
|
|
c2160b |
+ break;
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+
|
|
|
c2160b |
+ is_partial = !e_mail_part_get_validity (mail_part, check_valid_flags);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ /* Do not traverse sub-messages */
|
|
|
c2160b |
+ if (g_str_has_suffix (e_mail_part_get_id (mail_part), ".rfc822") &&
|
|
|
c2160b |
+ !g_str_equal (e_mail_part_get_id (mail_part), part_id_prefix))
|
|
|
c2160b |
+ link = e_mail_formatter_find_rfc822_end_iter (link);
|
|
|
c2160b |
+ }
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
- if (e_mail_part_get_validity (mail_part, E_MAIL_PART_VALIDITY_SMIME | E_MAIL_PART_VALIDITY_ENCRYPTED)) {
|
|
|
c2160b |
- if (tmp->len > 0)
|
|
|
c2160b |
- g_string_append (tmp, ", ");
|
|
|
c2160b |
- g_string_append (tmp, _("S/MIME encrypted"));
|
|
|
c2160b |
+ /* Add encryption/signature header */
|
|
|
c2160b |
+ tmp = g_string_new ("");
|
|
|
c2160b |
+
|
|
|
c2160b |
+ for (link = head; link; link = g_list_next (link)) {
|
|
|
c2160b |
+ EMailPart *mail_part = link->data;
|
|
|
c2160b |
+ const gchar *id = e_mail_part_get_id (mail_part);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (!e_mail_part_has_validity (mail_part) ||
|
|
|
c2160b |
+ !e_mail_part_id_has_prefix (mail_part, part_id_prefix))
|
|
|
c2160b |
+ continue;
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (should_skip_part (id))
|
|
|
c2160b |
+ continue;
|
|
|
c2160b |
+
|
|
|
c2160b |
+ for (ii = 0; ii < G_N_ELEMENTS (validity_flags); ii++) {
|
|
|
c2160b |
+ if (e_mail_part_get_validity (mail_part, validity_flags[ii].flags)) {
|
|
|
c2160b |
+ if (tmp->len > 0)
|
|
|
c2160b |
+ g_string_append (tmp, ", ");
|
|
|
c2160b |
+ g_string_append (tmp, is_partial ? _(validity_flags[ii].description_partial) : _(validity_flags[ii].description_complete));
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+
|
|
|
c2160b |
+ break;
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
- break;
|
|
|
c2160b |
- }
|
|
|
c2160b |
+ if (tmp->len > 0)
|
|
|
c2160b |
+ e_mail_formatter_format_header (formatter, buffer, _("Security"), tmp->str, flags, "UTF-8");
|
|
|
c2160b |
|
|
|
c2160b |
- if (tmp->len > 0) {
|
|
|
c2160b |
- e_mail_formatter_format_header (
|
|
|
c2160b |
- formatter, buffer,
|
|
|
c2160b |
- _("Security"), tmp->str,
|
|
|
c2160b |
- flags,
|
|
|
c2160b |
- "UTF-8");
|
|
|
c2160b |
+ g_string_free (tmp, TRUE);
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
+ #undef should_skip_part
|
|
|
c2160b |
+
|
|
|
c2160b |
while (!g_queue_is_empty (&queue))
|
|
|
c2160b |
g_object_unref (g_queue_pop_head (&queue));
|
|
|
c2160b |
|
|
|
c2160b |
- g_string_free (tmp, TRUE);
|
|
|
c2160b |
g_free (part_id_prefix);
|
|
|
c2160b |
}
|
|
|
c2160b |
diff -up evolution-3.28.5/src/em-format/e-mail-parser-application-smime.c.cve-2018-15587-reposition-signature-bar evolution-3.28.5/src/em-format/e-mail-parser-application-smime.c
|
|
|
c2160b |
--- evolution-3.28.5/src/em-format/e-mail-parser-application-smime.c.cve-2018-15587-reposition-signature-bar 2018-07-30 15:37:05.000000000 +0200
|
|
|
c2160b |
+++ evolution-3.28.5/src/em-format/e-mail-parser-application-smime.c 2019-10-24 16:21:32.730944332 +0200
|
|
|
c2160b |
@@ -22,6 +22,7 @@
|
|
|
c2160b |
|
|
|
c2160b |
#include <e-util/e-util.h>
|
|
|
c2160b |
|
|
|
c2160b |
+#include "e-mail-formatter-utils.h"
|
|
|
c2160b |
#include "e-mail-parser-extension.h"
|
|
|
c2160b |
#include "e-mail-part-utils.h"
|
|
|
c2160b |
|
|
|
c2160b |
@@ -104,6 +105,10 @@ empe_app_smime_parse (EMailParserExtensi
|
|
|
c2160b |
mail_part, valid,
|
|
|
c2160b |
E_MAIL_PART_VALIDITY_ENCRYPTED |
|
|
|
c2160b |
E_MAIL_PART_VALIDITY_SMIME);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ /* Do not traverse sub-messages */
|
|
|
c2160b |
+ if (g_str_has_suffix (e_mail_part_get_id (mail_part), ".rfc822"))
|
|
|
c2160b |
+ link = e_mail_formatter_find_rfc822_end_iter (link);
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
e_queue_transfer (&work_queue, out_mail_parts);
|
|
|
c2160b |
diff -up evolution-3.28.5/src/em-format/e-mail-parser.c.cve-2018-15587-reposition-signature-bar evolution-3.28.5/src/em-format/e-mail-parser.c
|
|
|
c2160b |
--- evolution-3.28.5/src/em-format/e-mail-parser.c.cve-2018-15587-reposition-signature-bar 2018-07-30 15:37:05.000000000 +0200
|
|
|
c2160b |
+++ evolution-3.28.5/src/em-format/e-mail-parser.c 2019-10-24 16:21:32.729944332 +0200
|
|
|
c2160b |
@@ -79,6 +79,67 @@ GType e_mail_parser_application_smime_ge
|
|
|
c2160b |
static gpointer parent_class;
|
|
|
c2160b |
|
|
|
c2160b |
static void
|
|
|
c2160b |
+mail_parser_move_security_before_headers (GQueue *part_queue)
|
|
|
c2160b |
+{
|
|
|
c2160b |
+ GList *link, *last_headers = NULL;
|
|
|
c2160b |
+ GSList *headers_stack = NULL;
|
|
|
c2160b |
+
|
|
|
c2160b |
+ link = g_queue_peek_head_link (part_queue);
|
|
|
c2160b |
+ while (link) {
|
|
|
c2160b |
+ EMailPart *part = link->data;
|
|
|
c2160b |
+ const gchar *id;
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (!part) {
|
|
|
c2160b |
+ link = g_list_next (link);
|
|
|
c2160b |
+ continue;
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+
|
|
|
c2160b |
+ id = e_mail_part_get_id (part);
|
|
|
c2160b |
+ if (!id) {
|
|
|
c2160b |
+ link = g_list_next (link);
|
|
|
c2160b |
+ continue;
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (g_str_has_suffix (id, ".rfc822")) {
|
|
|
c2160b |
+ headers_stack = g_slist_prepend (headers_stack, last_headers);
|
|
|
c2160b |
+ last_headers = NULL;
|
|
|
c2160b |
+ } else if (g_str_has_suffix (id, ".rfc822.end")) {
|
|
|
c2160b |
+ g_warn_if_fail (headers_stack != NULL);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (headers_stack) {
|
|
|
c2160b |
+ last_headers = headers_stack->data;
|
|
|
c2160b |
+ headers_stack = g_slist_remove (headers_stack, last_headers);
|
|
|
c2160b |
+ } else {
|
|
|
c2160b |
+ last_headers = NULL;
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (g_strcmp0 (e_mail_part_get_mime_type (part), "application/vnd.evolution.headers") == 0) {
|
|
|
c2160b |
+ last_headers = link;
|
|
|
c2160b |
+ link = g_list_next (link);
|
|
|
c2160b |
+ } else if (g_strcmp0 (e_mail_part_get_mime_type (part), "application/vnd.evolution.secure-button") == 0) {
|
|
|
c2160b |
+ g_warn_if_fail (last_headers != NULL);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (last_headers) {
|
|
|
c2160b |
+ GList *next = g_list_next (link);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ g_warn_if_fail (g_queue_remove (part_queue, part));
|
|
|
c2160b |
+ g_queue_insert_before (part_queue, last_headers, part);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ link = next;
|
|
|
c2160b |
+ } else {
|
|
|
c2160b |
+ link = g_list_next (link);
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+ } else {
|
|
|
c2160b |
+ link = g_list_next (link);
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+ }
|
|
|
c2160b |
+
|
|
|
c2160b |
+ g_warn_if_fail (headers_stack == NULL);
|
|
|
c2160b |
+ g_slist_free (headers_stack);
|
|
|
c2160b |
+}
|
|
|
c2160b |
+
|
|
|
c2160b |
+static void
|
|
|
c2160b |
mail_parser_run (EMailParser *parser,
|
|
|
c2160b |
EMailPartList *part_list,
|
|
|
c2160b |
GCancellable *cancellable)
|
|
|
c2160b |
@@ -132,6 +193,8 @@ mail_parser_run (EMailParser *parser,
|
|
|
c2160b |
break;
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
+ mail_parser_move_security_before_headers (&mail_part_queue);
|
|
|
c2160b |
+
|
|
|
c2160b |
while (!g_queue_is_empty (&mail_part_queue)) {
|
|
|
c2160b |
mail_part = g_queue_pop_head (&mail_part_queue);
|
|
|
c2160b |
e_mail_part_list_add_part (part_list, mail_part);
|
|
|
c2160b |
diff -up evolution-3.28.5/src/em-format/e-mail-parser-inlinepgp-encrypted.c.cve-2018-15587-reposition-signature-bar evolution-3.28.5/src/em-format/e-mail-parser-inlinepgp-encrypted.c
|
|
|
c2160b |
--- evolution-3.28.5/src/em-format/e-mail-parser-inlinepgp-encrypted.c.cve-2018-15587-reposition-signature-bar 2018-07-30 15:37:05.000000000 +0200
|
|
|
c2160b |
+++ evolution-3.28.5/src/em-format/e-mail-parser-inlinepgp-encrypted.c 2019-10-24 16:21:32.730944332 +0200
|
|
|
c2160b |
@@ -22,6 +22,7 @@
|
|
|
c2160b |
|
|
|
c2160b |
#include <e-util/e-util.h>
|
|
|
c2160b |
|
|
|
c2160b |
+#include "e-mail-formatter-utils.h"
|
|
|
c2160b |
#include "e-mail-parser-extension.h"
|
|
|
c2160b |
#include "e-mail-part-utils.h"
|
|
|
c2160b |
|
|
|
c2160b |
@@ -135,6 +136,10 @@ empe_inlinepgp_encrypted_parse (EMailPar
|
|
|
c2160b |
mail_part, valid,
|
|
|
c2160b |
E_MAIL_PART_VALIDITY_ENCRYPTED |
|
|
|
c2160b |
E_MAIL_PART_VALIDITY_PGP);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ /* Do not traverse sub-messages */
|
|
|
c2160b |
+ if (g_str_has_suffix (e_mail_part_get_id (mail_part), ".rfc822"))
|
|
|
c2160b |
+ link = e_mail_formatter_find_rfc822_end_iter (link);
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
e_queue_transfer (&work_queue, out_mail_parts);
|
|
|
c2160b |
diff -up evolution-3.28.5/src/em-format/e-mail-parser-inlinepgp-signed.c.cve-2018-15587-reposition-signature-bar evolution-3.28.5/src/em-format/e-mail-parser-inlinepgp-signed.c
|
|
|
c2160b |
--- evolution-3.28.5/src/em-format/e-mail-parser-inlinepgp-signed.c.cve-2018-15587-reposition-signature-bar 2018-07-30 15:37:05.000000000 +0200
|
|
|
c2160b |
+++ evolution-3.28.5/src/em-format/e-mail-parser-inlinepgp-signed.c 2019-10-24 16:21:32.731944332 +0200
|
|
|
c2160b |
@@ -22,6 +22,7 @@
|
|
|
c2160b |
|
|
|
c2160b |
#include <e-util/e-util.h>
|
|
|
c2160b |
|
|
|
c2160b |
+#include "e-mail-formatter-utils.h"
|
|
|
c2160b |
#include "e-mail-parser-extension.h"
|
|
|
c2160b |
#include "e-mail-part-utils.h"
|
|
|
c2160b |
|
|
|
c2160b |
@@ -142,6 +143,10 @@ empe_inlinepgp_signed_parse (EMailParser
|
|
|
c2160b |
mail_part, valid,
|
|
|
c2160b |
E_MAIL_PART_VALIDITY_SIGNED |
|
|
|
c2160b |
E_MAIL_PART_VALIDITY_PGP);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ /* Do not traverse sub-messages */
|
|
|
c2160b |
+ if (g_str_has_suffix (e_mail_part_get_id (mail_part), ".rfc822"))
|
|
|
c2160b |
+ link = e_mail_formatter_find_rfc822_end_iter (link);
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
e_queue_transfer (&work_queue, out_mail_parts);
|
|
|
c2160b |
diff -up evolution-3.28.5/src/em-format/e-mail-parser-multipart-encrypted.c.cve-2018-15587-reposition-signature-bar evolution-3.28.5/src/em-format/e-mail-parser-multipart-encrypted.c
|
|
|
c2160b |
--- evolution-3.28.5/src/em-format/e-mail-parser-multipart-encrypted.c.cve-2018-15587-reposition-signature-bar 2018-07-30 15:37:05.000000000 +0200
|
|
|
c2160b |
+++ evolution-3.28.5/src/em-format/e-mail-parser-multipart-encrypted.c 2019-10-24 16:21:32.731944332 +0200
|
|
|
c2160b |
@@ -21,6 +21,7 @@
|
|
|
c2160b |
|
|
|
c2160b |
#include <libedataserver/libedataserver.h>
|
|
|
c2160b |
|
|
|
c2160b |
+#include "e-mail-formatter-utils.h"
|
|
|
c2160b |
#include "e-mail-parser-extension.h"
|
|
|
c2160b |
#include "e-mail-part-utils.h"
|
|
|
c2160b |
|
|
|
c2160b |
@@ -126,6 +127,10 @@ empe_mp_encrypted_parse (EMailParserExte
|
|
|
c2160b |
mail_part, valid,
|
|
|
c2160b |
E_MAIL_PART_VALIDITY_ENCRYPTED |
|
|
|
c2160b |
E_MAIL_PART_VALIDITY_PGP);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ /* Do not traverse sub-messages */
|
|
|
c2160b |
+ if (g_str_has_suffix (e_mail_part_get_id (mail_part), ".rfc822"))
|
|
|
c2160b |
+ link = e_mail_formatter_find_rfc822_end_iter (link);
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
e_queue_transfer (&work_queue, out_mail_parts);
|
|
|
c2160b |
diff -up evolution-3.28.5/src/em-format/e-mail-parser-multipart-signed.c.cve-2018-15587-reposition-signature-bar evolution-3.28.5/src/em-format/e-mail-parser-multipart-signed.c
|
|
|
c2160b |
--- evolution-3.28.5/src/em-format/e-mail-parser-multipart-signed.c.cve-2018-15587-reposition-signature-bar 2018-07-30 15:37:05.000000000 +0200
|
|
|
c2160b |
+++ evolution-3.28.5/src/em-format/e-mail-parser-multipart-signed.c 2019-10-24 16:21:32.731944332 +0200
|
|
|
c2160b |
@@ -21,6 +21,7 @@
|
|
|
c2160b |
|
|
|
c2160b |
#include <libedataserver/libedataserver.h>
|
|
|
c2160b |
|
|
|
c2160b |
+#include "e-mail-formatter-utils.h"
|
|
|
c2160b |
#include "e-mail-parser-extension.h"
|
|
|
c2160b |
#include "e-mail-part-utils.h"
|
|
|
c2160b |
|
|
|
c2160b |
@@ -170,6 +171,10 @@ empe_mp_signed_parse (EMailParserExtensi
|
|
|
c2160b |
e_mail_part_update_validity (
|
|
|
c2160b |
mail_part, valid,
|
|
|
c2160b |
validity_type | E_MAIL_PART_VALIDITY_SIGNED);
|
|
|
c2160b |
+
|
|
|
c2160b |
+ /* Do not traverse sub-messages */
|
|
|
c2160b |
+ if (g_str_has_suffix (e_mail_part_get_id (mail_part), ".rfc822"))
|
|
|
c2160b |
+ link = e_mail_formatter_find_rfc822_end_iter (link);
|
|
|
c2160b |
}
|
|
|
c2160b |
|
|
|
c2160b |
e_queue_transfer (&work_queue, out_mail_parts);
|
|
|
c2160b |
diff -up evolution-3.28.5/src/em-format/e-mail-part.c.cve-2018-15587-reposition-signature-bar evolution-3.28.5/src/em-format/e-mail-part.c
|
|
|
c2160b |
--- evolution-3.28.5/src/em-format/e-mail-part.c.cve-2018-15587-reposition-signature-bar 2018-07-30 15:37:05.000000000 +0200
|
|
|
c2160b |
+++ evolution-3.28.5/src/em-format/e-mail-part.c 2019-10-24 16:21:32.731944332 +0200
|
|
|
c2160b |
@@ -662,6 +662,15 @@ e_mail_part_update_validity (EMailPart *
|
|
|
c2160b |
|
|
|
c2160b |
mask = E_MAIL_PART_VALIDITY_PGP | E_MAIL_PART_VALIDITY_SMIME;
|
|
|
c2160b |
|
|
|
c2160b |
+ /* Auto-add flags when the related part is present */
|
|
|
c2160b |
+ if (!(validity_type & E_MAIL_PART_VALIDITY_SIGNED) &&
|
|
|
c2160b |
+ validity->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE)
|
|
|
c2160b |
+ validity_type |= E_MAIL_PART_VALIDITY_SIGNED;
|
|
|
c2160b |
+
|
|
|
c2160b |
+ if (!(validity_type & E_MAIL_PART_VALIDITY_ENCRYPTED) &&
|
|
|
c2160b |
+ validity->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE)
|
|
|
c2160b |
+ validity_type |= E_MAIL_PART_VALIDITY_ENCRYPTED;
|
|
|
c2160b |
+
|
|
|
c2160b |
pair = mail_part_find_validity_pair (part, validity_type & mask);
|
|
|
c2160b |
if (pair != NULL) {
|
|
|
c2160b |
pair->validity_type |= validity_type;
|