Re: [PATCH v4 2/3] emacs: add notmuch-version.el.tmpl and create notmuch-version...
[notmuch-archives.git] / 87 / b48fc81480ea8912293b885bd9cfc3bd939b7b
1 Return-Path: <jrollins@servo.finestructure.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id B6EB0429E45\r
6         for <notmuch@notmuchmail.org>; Fri, 27 May 2011 03:28:02 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.921\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
12         tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id N237ZV22cWh9 for <notmuch@notmuchmail.org>;\r
17         Fri, 27 May 2011 03:28:01 -0700 (PDT)\r
18 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
19         [131.215.239.19])\r
20         by olra.theworths.org (Postfix) with ESMTP id D9E68429E4F\r
21         for <notmuch@notmuchmail.org>; Fri, 27 May 2011 03:27:52 -0700 (PDT)\r
22 Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
23         by fire-doxen-postvirus (Postfix) with ESMTP id 6DB9F32839A;\r
24         Fri, 27 May 2011 03:21:31 -0700 (PDT)\r
25 X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
26 Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com\r
27         [98.149.172.122]) (Authenticated sender: jrollins)\r
28         by fire-doxen-submit (Postfix) with ESMTP id C0952328393;\r
29         Fri, 27 May 2011 03:21:27 -0700 (PDT)\r
30 Received: by servo.finestructure.net (Postfix, from userid 1000)\r
31         id 20B0C26F; Fri, 27 May 2011 03:27:43 -0700 (PDT)\r
32 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
33 To: notmuch@notmuchmail.org\r
34 Subject: [PATCH 1/4] Do not replace multipart/signed part with content part\r
35         when doing verification.\r
36 Date: Fri, 27 May 2011 03:27:36 -0700\r
37 Message-Id: <1306492059-7706-2-git-send-email-jrollins@finestructure.net>\r
38 X-Mailer: git-send-email 1.7.4.4\r
39 In-Reply-To: <1306492059-7706-1-git-send-email-jrollins@finestructure.net>\r
40 References: <1306371680-19441-1-git-send-email-jrollins@finestructure.net>\r
41         <1306492059-7706-1-git-send-email-jrollins@finestructure.net>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Fri, 27 May 2011 10:28:02 -0000\r
55 \r
56 Some folks have complained about the part renumbering that occurs when\r
57 the entire multipart/signed part is replaced with the part contents\r
58 after verification.  This is primarily because it incurs an additional\r
59 computational cost to retrieve individual parts, since verification\r
60 has to be performed again to ensure that part numbering is consistent.\r
61 This patch simply leaves the full multipart/signed part as is.\r
62 \r
63 The emacs crypto test is also updated to reflect this change.\r
64 ---\r
65  show-message.c |    2 --\r
66  test/crypto    |   24 ++++++++++++++++++++----\r
67  2 files changed, 20 insertions(+), 6 deletions(-)\r
68 \r
69 diff --git a/show-message.c b/show-message.c\r
70 index 37252b2..849c686 100644\r
71 --- a/show-message.c\r
72 +++ b/show-message.c\r
73 @@ -105,8 +105,6 @@ show_message_part (GMimeObject *part,\r
74                 }\r
75                 if ((selected || state->in_zone) && format->part_sigstatus)\r
76                     format->part_sigstatus (sigvalidity);\r
77 -               /* extract only data part, and ignore signature part */\r
78 -               part = g_mime_multipart_get_part (multipart, 0);\r
79                 if (sigvalidity)\r
80                     g_mime_signature_validity_free (sigvalidity);\r
81             }\r
82 diff --git a/test/crypto b/test/crypto\r
83 index c5abcc3..ef35c55 100755\r
84 --- a/test/crypto\r
85 +++ b/test/crypto\r
86 @@ -57,8 +57,12 @@ expected='[[[{"id": "XXXXX",\r
87   "sigstatus": [{"status": "good",\r
88   "fingerprint": "'$FINGERPRINT'",\r
89   "created": 946728000}],\r
90 + "content-type": "multipart/signed",\r
91 + "content": [{"id": 2,\r
92   "content-type": "text/plain",\r
93 - "content": "This is a test signed message.\n"}]},\r
94 + "content": "This is a test signed message.\n"},\r
95 + {"id": 3,\r
96 + "content-type": "application/pgp-signature"}]}]},\r
97   []]]]'\r
98  test_expect_equal \\r
99      "$output" \\r
100 @@ -88,8 +92,12 @@ expected='[[[{"id": "XXXXX",\r
101   "fingerprint": "'$FINGERPRINT'",\r
102   "created": 946728000,\r
103   "userid": " Notmuch Test Suite <test_suite@notmuchmail.org> (INSECURE!)"}],\r
104 + "content-type": "multipart/signed",\r
105 + "content": [{"id": 2,\r
106   "content-type": "text/plain",\r
107 - "content": "This is a test signed message.\n"}]},\r
108 + "content": "This is a test signed message.\n"},\r
109 + {"id": 3,\r
110 + "content-type": "application/pgp-signature"}]}]},\r
111   []]]]'\r
112  test_expect_equal \\r
113      "$output" \\r
114 @@ -117,8 +125,12 @@ expected='[[[{"id": "XXXXX",\r
115   "sigstatus": [{"status": "error",\r
116   "keyid": "'$(echo $FINGERPRINT | cut -c 25-)'",\r
117   "errors": 2}],\r
118 + "content-type": "multipart/signed",\r
119 + "content": [{"id": 2,\r
120   "content-type": "text/plain",\r
121 - "content": "This is a test signed message.\n"}]},\r
122 + "content": "This is a test signed message.\n"},\r
123 + {"id": 3,\r
124 + "content-type": "application/pgp-signature"}]}]},\r
125   []]]]'\r
126  test_expect_equal \\r
127      "$output" \\r
128 @@ -320,8 +332,12 @@ expected='[[[{"id": "XXXXX",\r
129   "sigstatus": [{"status": "error",\r
130   "keyid": "6D92612D94E46381",\r
131   "errors": 8}],\r
132 + "content-type": "multipart/signed",\r
133 + "content": [{"id": 2,\r
134   "content-type": "text/plain",\r
135 - "content": "This is a test signed message.\n"}]},\r
136 + "content": "This is a test signed message.\n"},\r
137 + {"id": 3,\r
138 + "content-type": "application/pgp-signature"}]}]},\r
139   []]]]'\r
140  test_expect_equal \\r
141      "$output" \\r
142 -- \r
143 1.7.4.4\r
144 \r