Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B6EB0429E45 for ; Fri, 27 May 2011 03:28:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.921 X-Spam-Level: X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N237ZV22cWh9 for ; Fri, 27 May 2011 03:28:01 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id D9E68429E4F for ; Fri, 27 May 2011 03:27:52 -0700 (PDT) Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) by fire-doxen-postvirus (Postfix) with ESMTP id 6DB9F32839A; Fri, 27 May 2011 03:21:31 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com [98.149.172.122]) (Authenticated sender: jrollins) by fire-doxen-submit (Postfix) with ESMTP id C0952328393; Fri, 27 May 2011 03:21:27 -0700 (PDT) Received: by servo.finestructure.net (Postfix, from userid 1000) id 20B0C26F; Fri, 27 May 2011 03:27:43 -0700 (PDT) From: Jameson Graef Rollins 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 Message-Id: <1306492059-7706-2-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306492059-7706-1-git-send-email-jrollins@finestructure.net> References: <1306371680-19441-1-git-send-email-jrollins@finestructure.net> <1306492059-7706-1-git-send-email-jrollins@finestructure.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 10:28:02 -0000 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 (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