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 8DD2E6DE0941 for ; Mon, 9 Oct 2017 22:49:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 cIozJI3pklnM for ; Mon, 9 Oct 2017 22:49:30 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id 1ADA06DE0962 for ; Mon, 9 Oct 2017 22:49:28 -0700 (PDT) Received: from fifthhorseman.net (cpe-74-71-53-242.nyc.res.rr.com [74.71.53.242]) by che.mayfirst.org (Postfix) with ESMTPSA id 316CCF99A; Tue, 10 Oct 2017 01:49:26 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id E4A65203A4; Mon, 9 Oct 2017 23:33:57 -0400 (EDT) From: Daniel Kahn Gillmor To: Jani Nikula , Notmuch Mail Subject: Re: [PATCH v2 02/10] crypto: make shared crypto code behave library-like In-Reply-To: <87zi9lfmvh.fsf@nikula.org> References: <20170912230153.4175-10-dkg@fifthhorseman.net> <20170915055359.24123-1-dkg@fifthhorseman.net> <20170915055359.24123-3-dkg@fifthhorseman.net> <87zi9lfmvh.fsf@nikula.org> Date: Mon, 09 Oct 2017 23:33:54 -0400 Message-ID: <87sherk76l.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: Tue, 10 Oct 2017 05:49:30 -0000 --=-=-= Content-Type: text/plain On Sat 2017-09-23 18:36:18 +0300, Jani Nikula wrote: >> if (!cryptoctx) >> return NULL; > > I guess this will work because we initialize cryptoctx to NULL, but if > we return the status, I think we should trust status == success means > cryptoctx is fine, and otherwise we shouldn't touch or look at > cryptoctx. this function (_mime_node_create) is *not* returning the status -- it's returning the mime node. a non-successful status might or might not mean that the cryptoctx is set up. so i could move this check within the "if (status)" if you prefer, but if we're going to do the check here, i don't see why we wouldn't just do it regardless of status. at any rate, this is all within the gmime 2.6 variant, and we'll be able to clean it out once we move to gmime 3.0. so i've left this part as-is, while having addressed the rest of your feedback. thanks for the review! --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEOCdgUepHf6PklTkyFJitxsGSMjcFAlncP6IACgkQFJitxsGS Mje1lBAAvuF4aVQm+McmnLRXai7cW8lNolQGf2jn1StSp8p4zF1JevPeXAZUiw8e hFHCiQ/lbb8k0EYZdg500/P50OGQvQ37WjSjSrmbQGbP1TsK+q47GFYAZQA8q37H auFLmzTeu1ht5PDY+o5nHLokJ6XE1yUOr66CuOAipcJv8w+PHqUXoLMPnCCTUjio lCXrKHhZBebuVqgEegGip9tBYA01TtrFwOK/1375A6KaBJKWeJzUr8KJsp1F4Kuw IKOBwNextyCTROn6lBOsrdgHvul+RElBs1V2EcGtDtADyeNc6NnIXTGGUa2vXJBo EwWJpqE5ZTYA3a23SM3BACV0nUnxrSCixu1mBL4ZmnLR/TNEL/we+amSDY87mEmK ZvLXXnphHV5e9evO+i6CE2E1NCPIySy6/OcdG+R2numEKZhlSEhXi1cmY5sW3EEe Hpich9osAtClenL2smWWJhWuSRCVFRN3XoR9f45+6ZUilbernXnafI7snVQ9RSer aN9zqQ7F4E/ZzVWkmOzs2+3PuJRRPFpab68jWqhCUPiFsSUojONj47PSYYTj3wLU 3ri1hCOwfyM0YuMFzb6EX4suMwRuUv8F+bvC3Bp3z4v/zPIqPDEfBcUltQYq6cNf +LJpWaWWp2QVDvyEH0ts2c3UFrmgHEYOwcvXx0gmCWnvurGnpAc= =zMAm -----END PGP SIGNATURE----- --=-=-=--