From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 6D02B6DE0B7C for ; Sat, 11 Nov 2017 19:51:28 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.05 X-Spam-Level: X-Spam-Status: No, score=-0.05 tagged_above=-999 required=5 tests=[AWL=-0.050] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D1wy7lNzunzr for ; Sat, 11 Nov 2017 19:51:27 -0800 (PST) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id 8CA256DE0B64 for ; Sat, 11 Nov 2017 19:51:27 -0800 (PST) Received: from fifthhorseman.net (dhcp-97f5.meeting.ietf.org [31.133.151.245]) by che.mayfirst.org (Postfix) with ESMTPSA id 4B201F99A; Sat, 11 Nov 2017 22:51:24 -0500 (EST) Received: by fifthhorseman.net (Postfix, from userid 1000) id 0EC722047F; Sun, 12 Nov 2017 11:39:33 +0800 (+08) From: Daniel Kahn Gillmor To: Jameson Graef Rollins , Notmuch Mail Subject: Re: [PATCH 07/18] crypto: new decryption policy "auto" In-Reply-To: <87r2t4s91g.fsf@ligo.caltech.edu> References: <20171025065203.24403-1-dkg@fifthhorseman.net> <20171025065203.24403-8-dkg@fifthhorseman.net> <87r2t4s91g.fsf@ligo.caltech.edu> Date: Sun, 12 Nov 2017 11:39:30 +0800 Message-ID: <87wp2w17yl.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Sun, 12 Nov 2017 03:51:28 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat 2017-11-11 15:14:03 -0800, Jameson Graef Rollins wrote: > On Wed, Oct 25 2017, Daniel Kahn Gillmor wrote: >> diff --git a/util/crypto.h b/util/crypto.h >> index b23ca747..dc95b4ca 100644 >> --- a/util/crypto.h >> +++ b/util/crypto.h >> @@ -16,7 +16,8 @@ typedef struct _notmuch_crypto { >> } _notmuch_crypto_t; >>=20=20 >> GMimeObject * >> -_notmuch_crypto_decrypt (notmuch_message_t *message, >> +_notmuch_crypto_decrypt (notmuch_decryption_policy_t decrypt, >> + notmuch_message_t *message, >> GMimeCryptoContext* crypto_ctx, >> GMimeMultipartEncrypted *part, >> GMimeDecryptResult **decrypt_result, > > Why does _notmuch_crypt_decrypt need to have > "notmuch_decryption_policy_t decrypt" as an input argument? Isn't > notmuch_decryption_policy_t already an attribute of the crypto_ctx? Is > there some situation where the policy would differ from what's specified > in the crypto_ctx? crypto_ctx here is just a GMimeCryptoContext, which doesn't know anything about notmuch_decryption_policy_t. Maybe i'm misunderstanding your question? I'd be happy to streamline the interface to this internal function, but given that it's not an exported API, i'm not as concerned about things like future cleanliness -- the notmuch source contains all invocations of the function anywhere, so if we find a nicer way to streamline it in the future, we can do that cleanup across the codebase in a single commit. Thanks for the review! --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEOCdgUepHf6PklTkyFJitxsGSMjcFAloHwnIACgkQFJitxsGS Mje04A//TdXwMPmCBFhB7i6EgUHMvzka2xVU7yUevvxlbOox71QOstDLMqJsg4J6 wzDrygn2kH/pRRCiXBh110JvK0R6HLTbgLDBSCghQmJK+Mbs6xLFyRHvJXrPgcyy 363Qohu3RkHiMu4PD+WLUSNsopajJFH9/hAY68i93HEr9ekT73k+eNqdIUMcU9zN /xWjsN+2RYGvjmn1yAMYD8S+WA4YqEb+sOuX9HX20qaWZ7ZcQYmz1u4v2b+pySCD pT1CT5CukKbZISxbx5f0/xXx7uUJAYHQP6X720f0ygpVL8hpIPVpdlOaRh/1L6li lbIWBeVvjpVxsUngqQIHdPj1vllGU9XDLwaKQyITlTN8hvbXXFrRb39WOocqCLNw KoxwFmTKWsbYF9eaWgAXNd47i/LQB6g/ld5oScJcqlABkbUtAybA1hHk0acKkKaB RQ1idsAgaNc4LYB5mLgDZ7f08Os9DMLR2gLihz6BEXITn9KxRgv85kg1/WlXbSRh l2+C4Em5wovaXnLCoU5Iuw3q+mcCoHNq9v5Hdi5v6e7zFAsKxMorTP9r8ZYtOeSC ltozXiR4iSXPZG3BeBua2rIY5nuvxAwAz/wgUFdrFhpnTtRwwOpjFmjsZNPEE2aE DFocyBXKNm9+vRSeIrd1sJ1wwFA+yFgl+gOg+ELyFCI6Vpk3r8o= =2Oqe -----END PGP SIGNATURE----- --=-=-=--