Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRKcf-0002Qy-0x for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Dec 2017 16:20:05 +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 1eRKce-0007VZ-A1 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Dec 2017 16:20:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eRKcd-0007VO-Mk for pgsql-hackers@lists.postgresql.org; Tue, 19 Dec 2017 16:20:04 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eRKca-0007ks-PS for pgsql-hackers@postgresql.org; Tue, 19 Dec 2017 16:20:02 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 62A5C2098A; Tue, 19 Dec 2017 11:19:59 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Tue, 19 Dec 2017 11:19:59 -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=/yJG1H gdj8E58Nk1EhMwkfeo3gSJWEDLCnOsvOqrsHg=; b=hVLKziOZoEdV+vXE3vWK9b xVUeeUMThpfA6RlY8o+6CXhGlGdzbCScI0NzyTrQL1S+jfkSNl1F5tNl39p4GgwW Pnmuqi0ZAjMgRj+C4RDCFpg5tjUWIgcVmnp4+uvkWjSFqmVJR+1B74a0sNG7V21u hF/xs0deHtLKId84lj3SaKuOmVdoeKzaIcR+4TnMbhz6p3xTgrrXEWkRVCYR9k2D Dksv6v8U19YYTx+htpRw1MoRh2bYlS3c0IUrNX7ZkaRy0HXSMgIB/XJ0yL/o8v4q u2degoZHYKU2e80rOk5gGHn0ZYzEgP2Q7k3m7tCL1FeZR92nJnydWcQsxlPo53rw == 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 13A8C24009; Tue, 19 Dec 2017 11:19:59 -0500 (EST) Subject: Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256 To: Michael Paquier References: <20170530151432.GW3151@tamriel.snowman.net> <7fe055c6-0885-833b-054d-124e3c3acdf9@2ndquadrant.com> <887b6fb7-15fe-239e-2aad-5911d2b0945b@2ndquadrant.com> <2751aafc-8341-1c3d-c3e2-5abed914a6a4@2ndquadrant.com> <6de87398-a9da-aa8b-a4c2-ca06ef8d757c@2ndquadrant.com> Cc: Robert Haas , =?UTF-8?Q?=c3=81lvaro_Hern=c3=a1ndez_Tortosa?= , "pgsql-hackers@postgresql.org" From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <0eeb65bc-7f7d-064f-bbe2-5814c9763873@2ndquadrant.com> Date: Tue, 19 Dec 2017 11:19:58 -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 11/30/17 21:11, Michael Paquier wrote: > OK, here is a reworked version with the following changes: > - renamed saslchannelbinding to scramchannelbinding, with a default > set to tls-unique. > - An empty value of scramchannelbinding allows client to not use > channel binding, or in short use use SCRAM-SHA-256 and cbind-flag set > to 'n'. > > While reviewing the code, I have found something a bit disturbing with > the header definitions: the libpq frontend code includes scram.h, > which references backend-side routines. So I think that the definition > of the SCRAM mechanisms as well as the channel binding types should be > moved to scram-common.h. This cleanup is included in 0001. I have committed 0001 and 0002 (renaming to scram_channel_binding). The 0003 patch looks mostly fine as well. The only concern I have is that the way it is set up now, we make the server compute the channel binding data for both tls-unique and tls-server-end-point, even though we only end up using one. This might need some restructuring so that we only get the data we need once we have learned which channel binding type the client requested. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services