unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jameson Graef Rollins <jrollins@finestructure.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/4] Do not replace multipart/signed part with content part when doing verification.
Date: Fri, 27 May 2011 03:27:36 -0700	[thread overview]
Message-ID: <1306492059-7706-2-git-send-email-jrollins@finestructure.net> (raw)
In-Reply-To: <1306492059-7706-1-git-send-email-jrollins@finestructure.net>

Some folks have complained about the part renumbering that occurs when
the entire multipart/signed part is replaced with the part contents
after verification.  This is primarily because it incurs an additional
computational cost to retrieve individual parts, since verification
has to be performed again to ensure that part numbering is consistent.
This patch simply leaves the full multipart/signed part as is.

The emacs crypto test is also updated to reflect this change.
---
 show-message.c |    2 --
 test/crypto    |   24 ++++++++++++++++++++----
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/show-message.c b/show-message.c
index 37252b2..849c686 100644
--- a/show-message.c
+++ b/show-message.c
@@ -105,8 +105,6 @@ show_message_part (GMimeObject *part,
 		}
 		if ((selected || state->in_zone) && format->part_sigstatus)
 		    format->part_sigstatus (sigvalidity);
-		/* extract only data part, and ignore signature part */
-		part = g_mime_multipart_get_part (multipart, 0);
 		if (sigvalidity)
 		    g_mime_signature_validity_free (sigvalidity);
 	    }
diff --git a/test/crypto b/test/crypto
index c5abcc3..ef35c55 100755
--- a/test/crypto
+++ b/test/crypto
@@ -57,8 +57,12 @@ expected='[[[{"id": "XXXXX",
  "sigstatus": [{"status": "good",
  "fingerprint": "'$FINGERPRINT'",
  "created": 946728000}],
+ "content-type": "multipart/signed",
+ "content": [{"id": 2,
  "content-type": "text/plain",
- "content": "This is a test signed message.\n"}]},
+ "content": "This is a test signed message.\n"},
+ {"id": 3,
+ "content-type": "application/pgp-signature"}]}]},
  []]]]'
 test_expect_equal \
     "$output" \
@@ -88,8 +92,12 @@ expected='[[[{"id": "XXXXX",
  "fingerprint": "'$FINGERPRINT'",
  "created": 946728000,
  "userid": " Notmuch Test Suite <test_suite@notmuchmail.org> (INSECURE!)"}],
+ "content-type": "multipart/signed",
+ "content": [{"id": 2,
  "content-type": "text/plain",
- "content": "This is a test signed message.\n"}]},
+ "content": "This is a test signed message.\n"},
+ {"id": 3,
+ "content-type": "application/pgp-signature"}]}]},
  []]]]'
 test_expect_equal \
     "$output" \
@@ -117,8 +125,12 @@ expected='[[[{"id": "XXXXX",
  "sigstatus": [{"status": "error",
  "keyid": "'$(echo $FINGERPRINT | cut -c 25-)'",
  "errors": 2}],
+ "content-type": "multipart/signed",
+ "content": [{"id": 2,
  "content-type": "text/plain",
- "content": "This is a test signed message.\n"}]},
+ "content": "This is a test signed message.\n"},
+ {"id": 3,
+ "content-type": "application/pgp-signature"}]}]},
  []]]]'
 test_expect_equal \
     "$output" \
@@ -320,8 +332,12 @@ expected='[[[{"id": "XXXXX",
  "sigstatus": [{"status": "error",
  "keyid": "6D92612D94E46381",
  "errors": 8}],
+ "content-type": "multipart/signed",
+ "content": [{"id": 2,
  "content-type": "text/plain",
- "content": "This is a test signed message.\n"}]},
+ "content": "This is a test signed message.\n"},
+ {"id": 3,
+ "content-type": "application/pgp-signature"}]}]},
  []]]]'
 test_expect_equal \
     "$output" \
-- 
1.7.4.4

  reply	other threads:[~2011-05-27 10:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26  1:01 New crypto patch series Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 01/11] Simplify reply_part function to eliminate redundant code paths Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 02/11] Integrate reply_part_content function into reply_part function Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 03/11] Use empty strings instead of NULL in format_reply structure Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 04/11] Break up format->part function into part_start and part_content functions Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 05/11] test: new test-lib function to test for equality between files Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 06/11] test: add notmuch_show_sanitize_all function that is a little more aggressive Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 07/11] test: add crypto tests for signature verification and decryption Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 08/11] Add signature verification of PGP/MIME-signed parts with --verify Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 09/11] Add decryption of PGP/MIME-encrypted parts with --decrypt Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 10/11] emacs: Add support for PGP/MIME verification/decryption Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 11/11] tag signed/encrypted during notmuch new Jameson Graef Rollins
2011-05-27 10:27 ` normalizing part numbering across PGP/MIME processing Jameson Graef Rollins
2011-05-27 10:27   ` Jameson Graef Rollins [this message]
2011-05-27 10:27     ` [PATCH 2/4] Render all parts of multipart/encrypted when decrypting Jameson Graef Rollins
2011-05-27 10:27       ` [PATCH 3/4] emacs: Do not attempt to render arbitrary application parts Jameson Graef Rollins
2011-05-27 10:27         ` [PATCH 4/4] emacs: Give mutlipart/{signed, encrypted} their own part handler Jameson Graef Rollins
2011-05-27 18:52           ` [PATCH] " Jameson Graef Rollins
2011-05-27 18:34   ` normalizing part numbering across PGP/MIME processing Daniel Kahn Gillmor
2011-05-28  0:53   ` Carl Worth
2011-05-28 21:31     ` Jameson Graef Rollins
2011-06-03 21:34       ` Carl Worth
2011-06-03 23:03     ` [PATCH] Always return the empty string if decryption tries to demand a password Daniel Kahn Gillmor
2011-06-03 23:15       ` Carl Worth
2011-06-03 23:37         ` Daniel Kahn Gillmor
2011-06-03 23:57           ` [PATCH] Use stock GMimeSession by default Daniel Kahn Gillmor
2011-06-03 23:57             ` Daniel Kahn Gillmor
2011-06-04  1:11               ` Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306492059-7706-2-git-send-email-jrollins@finestructure.net \
    --to=jrollins@finestructure.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).