database error
[notmuch-archives.git] / 65 / b23d3146f4fffe4ed4bd308eca5d27b787d319
1 Return-Path: <jani@nikula.org>\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 9C44E431FAF\r
6         for <notmuch@notmuchmail.org>; Thu, 17 May 2012 00:37:27 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id HC7M6BJG7I8W for <notmuch@notmuchmail.org>;\r
16         Thu, 17 May 2012 00:37:27 -0700 (PDT)\r
17 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
18         [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id AC837431FAE\r
21         for <notmuch@notmuchmail.org>; Thu, 17 May 2012 00:37:26 -0700 (PDT)\r
22 Received: by lagu2 with SMTP id u2so1266761lag.26\r
23         for <notmuch@notmuchmail.org>; Thu, 17 May 2012 00:37:25 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type:x-gm-message-state;\r
28         bh=eFBqjgKqEMBwO0Ser/USnktTsHY87Fkz2ao5Vit23Ys=;\r
29         b=h8wuW8GZkYdpwnW9aQ8F8SyFs9uQ1RtgEOSkdZt7wsChUrQkDp3catbs/4TY7BYylJ\r
30         RXPgtZ4nJUHcf9k0vH3WBEYgMRa7NPqRIFZnw7ZfCBP1hFvyzxuEKjscsSgrFj0Kc4oG\r
31         dwSy4zxIBFtZdc7JuUp6TN6cKbY2z2DiyY1XvMhaOt9OQN6pr7HZqzpQxE1hKA8v83Td\r
32         vE/P7Syi43/3H3PJ9CQM7M9vPiKsNh5YCUVGjCCf4TCTLWlGYj3uxUpK/pUCOV4oNHEM\r
33         67NW1gV4hSKzcjXGE9VyZi61O6ft/0KClUABahJfboT4hnPOXHsmpkTCw8amhyiO62yW\r
34         Sqrw==\r
35 Received: by 10.112.101.105 with SMTP id ff9mr2620161lbb.44.1337240245044;\r
36         Thu, 17 May 2012 00:37:25 -0700 (PDT)\r
37 Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.\r
38         [80.220.80.68])\r
39         by mx.google.com with ESMTPS id hi14sm6708122lab.4.2012.05.17.00.37.23\r
40         (version=SSLv3 cipher=OTHER); Thu, 17 May 2012 00:37:24 -0700 (PDT)\r
41 From: Jani Nikula <jani@nikula.org>\r
42 To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
43         Notmuch Mail <notmuch@notmuchmail.org>\r
44 Subject: Re: [PATCH 2/6] cli: modify mime_node_context to use the new\r
45         notmuch_crypto_t\r
46 In-Reply-To: <1337205359-2444-3-git-send-email-jrollins@finestructure.net>\r
47 References: <1337205359-2444-1-git-send-email-jrollins@finestructure.net>\r
48         <1337205359-2444-2-git-send-email-jrollins@finestructure.net>\r
49         <1337205359-2444-3-git-send-email-jrollins@finestructure.net>\r
50 User-Agent: Notmuch/0.13+13~gc259b9a (http://notmuchmail.org) Emacs/23.3.1\r
51         (i686-pc-linux-gnu)\r
52 Date: Thu, 17 May 2012 10:37:21 +0300\r
53 Message-ID: <87bolni7gu.fsf@nikula.org>\r
54 MIME-Version: 1.0\r
55 Content-Type: text/plain; charset=us-ascii\r
56 X-Gm-Message-State:\r
57  ALoCoQnZoewMRl1+DRMZnmhjdTNrUk4W5g3qkNqRGv0gWjIhxA6KETuoiu7+pEQmJhVKysjmFRcd\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Thu, 17 May 2012 07:37:27 -0000\r
71 \r
72 On Thu, 17 May 2012, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
73 > This simplifies some more interfaces and gets rid of another #ifdef.\r
74 \r
75 LGTM.\r
76 \r
77 > ---\r
78 >  mime-node.c |   23 +++++++++--------------\r
79 >  1 file changed, 9 insertions(+), 14 deletions(-)\r
80 >\r
81 > diff --git a/mime-node.c b/mime-node.c\r
82 > index a95bdab..79a3654 100644\r
83 > --- a/mime-node.c\r
84 > +++ b/mime-node.c\r
85 > @@ -33,12 +33,7 @@ typedef struct mime_node_context {\r
86 >      GMimeMessage *mime_message;\r
87 >  \r
88 >      /* Context provided by the caller. */\r
89 > -#ifdef GMIME_ATLEAST_26\r
90 > -    GMimeCryptoContext *cryptoctx;\r
91 > -#else\r
92 > -    GMimeCipherContext *cryptoctx;\r
93 > -#endif\r
94 > -    notmuch_bool_t decrypt;\r
95 > +    notmuch_crypto_t crypto;\r
96 >  } mime_node_context_t;\r
97 >  \r
98 >  static int\r
99 > @@ -118,8 +113,8 @@ mime_node_open (const void *ctx, notmuch_message_t *message,\r
100 >       goto DONE;\r
101 >      }\r
102 >  \r
103 > -    mctx->cryptoctx = cryptoctx;\r
104 > -    mctx->decrypt = decrypt;\r
105 > +    mctx->crypto.gpgctx = cryptoctx;\r
106 > +    mctx->crypto.decrypt = decrypt;\r
107 >  \r
108 >      /* Create the root node */\r
109 >      root->part = GMIME_OBJECT (mctx->mime_message);\r
110 > @@ -195,7 +190,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
111 >  \r
112 >      /* Handle PGP/MIME parts */\r
113 >      if (GMIME_IS_MULTIPART_ENCRYPTED (part)\r
114 > -     && node->ctx->cryptoctx && node->ctx->decrypt) {\r
115 > +     && node->ctx->crypto.gpgctx && node->ctx->crypto.decrypt) {\r
116 >       if (node->nchildren != 2) {\r
117 >           /* this violates RFC 3156 section 4, so we won't bother with it. */\r
118 >           fprintf (stderr, "Error: %d part(s) for a multipart/encrypted "\r
119 > @@ -208,10 +203,10 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
120 >  #ifdef GMIME_ATLEAST_26\r
121 >           GMimeDecryptResult *decrypt_result = NULL;\r
122 >           node->decrypted_child = g_mime_multipart_encrypted_decrypt\r
123 > -             (encrypteddata, node->ctx->cryptoctx, &decrypt_result, &err);\r
124 > +             (encrypteddata, node->ctx->crypto.gpgctx, &decrypt_result, &err);\r
125 >  #else\r
126 >           node->decrypted_child = g_mime_multipart_encrypted_decrypt\r
127 > -             (encrypteddata, node->ctx->cryptoctx, &err);\r
128 > +             (encrypteddata, node->ctx->crypto.gpgctx, &err);\r
129 >  #endif\r
130 >           if (node->decrypted_child) {\r
131 >               node->decrypt_success = node->verify_attempted = TRUE;\r
132 > @@ -229,7 +224,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
133 >                        (err ? err->message : "no error explanation given"));\r
134 >           }\r
135 >       }\r
136 > -    } else if (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->cryptoctx) {\r
137 > +    } else if (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto.gpgctx) {\r
138 >       if (node->nchildren != 2) {\r
139 >           /* this violates RFC 3156 section 5, so we won't bother with it. */\r
140 >           fprintf (stderr, "Error: %d part(s) for a multipart/signed message "\r
141 > @@ -238,7 +233,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
142 >       } else {\r
143 >  #ifdef GMIME_ATLEAST_26\r
144 >           node->sig_list = g_mime_multipart_signed_verify\r
145 > -             (GMIME_MULTIPART_SIGNED (part), node->ctx->cryptoctx, &err);\r
146 > +             (GMIME_MULTIPART_SIGNED (part), node->ctx->crypto.gpgctx, &err);\r
147 >           node->verify_attempted = TRUE;\r
148 >  \r
149 >           if (!node->sig_list)\r
150 > @@ -254,7 +249,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)\r
151 >            * In GMime 2.6, they're both non-const, so we'll be able\r
152 >            * to clean up this asymmetry. */\r
153 >           GMimeSignatureValidity *sig_validity = g_mime_multipart_signed_verify\r
154 > -             (GMIME_MULTIPART_SIGNED (part), node->ctx->cryptoctx, &err);\r
155 > +             (GMIME_MULTIPART_SIGNED (part), node->ctx->crypto.gpgctx, &err);\r
156 >           node->verify_attempted = TRUE;\r
157 >           node->sig_validity = sig_validity;\r
158 >           if (sig_validity) {\r
159 > -- \r
160 > 1.7.10\r
161 >\r
162 > _______________________________________________\r
163 > notmuch mailing list\r
164 > notmuch@notmuchmail.org\r
165 > http://notmuchmail.org/mailman/listinfo/notmuch\r