Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTvpl-0007kg-KM for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Dec 2017 20:28:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTvpj-0000MO-SY for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Dec 2017 20:28:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eTvpj-0000MD-Ec for pgsql-hackers@lists.postgresql.org; Tue, 26 Dec 2017 20:28:19 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eTvpc-0007WO-9b for pgsql-hackers@postgresql.org; Tue, 26 Dec 2017 20:28:15 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 168E620CA3; Tue, 26 Dec 2017 15:28:10 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Tue, 26 Dec 2017 15:28:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=87b91r RHLv1Veg2yNjbIdzlaeGhFUfv2QBBZf6/sOZE=; b=nFh4Bi7pInpzfnh/8Zvm6t juTHxXvfo+IOvUv/ZTLSTnEoadcmrKUp4ILuW9mLdOulU0q0nMrK0q0L3epN7b+q vQ4SJ1NWKH/LqoGHa9+uBHQqc6W0s/oEwNx7lq1IbOJX33qLYce/If9+c/Vtvla6 IeFfLUvlvwF7g8/zZGwLz37aLxU4Vu9s24hqQCiFE0w/lWV5PdV5O9kPFd6Yubs7 G5uOcnQn3X1b1ovjKeGw1C5ks9qGpGNuR3usCO8iZHT+pmM4/zFLnqVG2I5wPqiv sTV+/+LXjrOig5RVubsdZ0N/9hiLcIc0HFb1xh/DVIubm3IeNR2+OZu8VvmCaRgQ == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id BA48224235; Tue, 26 Dec 2017 15:28:09 -0500 (EST) Subject: Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256 To: Michael Paquier References: <2751aafc-8341-1c3d-c3e2-5abed914a6a4@2ndquadrant.com> <6de87398-a9da-aa8b-a4c2-ca06ef8d757c@2ndquadrant.com> <0eeb65bc-7f7d-064f-bbe2-5814c9763873@2ndquadrant.com> <20171222025908.GA11776@paquier.xyz> Cc: Robert Haas , =?UTF-8?Q?=c3=81lvaro_Hern=c3=a1ndez_Tortosa?= , "pgsql-hackers@postgresql.org" From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <63b10730-d6d6-fe96-c86b-b2ef4d320be7@2ndquadrant.com> Date: Tue, 26 Dec 2017 15:28:09 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/22/17 03:10, Michael Paquier wrote: > On Fri, Dec 22, 2017 at 11:59 AM, Michael Paquier > wrote: >> I have looked at how things could be done in symmetry for both the frontend >> and backend code, and I have produced the attached patch 0002, which >> can be applied on top of 0001 implementing tls-server-end-point. This >> simplifies the interfaces to initialize the SCRAM status data by saving >> into scram_state and fe_scram_state respectively Port* and PGconn* which >> holds most of the data needed for the exchange. With this patch, cbind_data >> is generated only if a specific channel binding type is used with the >> appropriate data. So if no channel binding is used there is no additional >> SSL call done to get the TLS finished data or the server certificate hash. >> >> 0001 has no real changes compared to the last versions. > > Second thoughts on 0002 as there is actually no need to move around > errorMessage if the PGconn* pointer is saved in the SCRAM status data > as both are linked. The attached simplifies the logic even more. > That all looks pretty reasonable. I'm working through patch 0001 now. I haven't found any documentation on the function OBJ_find_sigid_algs(). What does it do? One might think that the nid returned by X509_get_signature_nid() is already the algo_nid we want to use, but there appears to be more to this. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services