Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFkVc-0002Vv-US for pgsql-jdbc@arkaria.postgresql.org; Tue, 30 May 2017 17:00:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dFkVc-0000MV-Fs for pgsql-jdbc@arkaria.postgresql.org; Tue, 30 May 2017 17:00:40 +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 1dFkVb-0000Ik-Ed; Tue, 30 May 2017 17:00:39 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFkVY-0005mS-MF; Tue, 30 May 2017 17:00:38 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 5F3E05F797; Tue, 30 May 2017 13:00:36 -0400 (EDT) Date: Tue, 30 May 2017 13:00:36 -0400 From: Stephen Frost To: Michael Paquier Cc: Tom Lane , Robert Haas , =?iso-8859-1?Q?=C1lvaro_Hern=E1ndez?= Tortosa , "pgsql-hackers@postgresql.org" , PostgreSQL JDBC List Subject: Re: [HACKERS] Channel binding support for SCRAM-SHA-256 Message-ID: <20170530170036.GZ3151@tamriel.snowman.net> References: <4e65d7cc-63bd-9515-83d6-85b03dbb4f21@8kdata.com> <13406.1496155822@sss.pgh.pa.us> <20170530151432.GW3151@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="td4qgJ5lbWoVlCUd" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-117-generic (x86_64) X-Uptime: 12:57:30 up 21 days, 17:30, 8 users, load average: 0.18, 0.19, 0.16 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org --td4qgJ5lbWoVlCUd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Michael, * Michael Paquier (michael.paquier@gmail.com) wrote: > On Tue, May 30, 2017 at 8:14 AM, Stephen Frost wrote: > > The specific APIs are, certainly, going to be different between > > different TLS implementations and I don't believe we need to be > > particularly concerned with that (or if they change in the future), as > > long as we abstract those APIs. Perhaps there's some question as to > > just how to abstract them, but I'm at least a bit less concerned with > > that as I expect we'll be able to adjust those abstraction layers later > > (presuming they aren't exposed, which I wouldn't expect them to be). >=20 > The current patch fetches the TLS finish message data just after the > handshake in be_tls_open_server() using the dedicated OpenSSL API. We > could definitely go with a more generic routine on our side that > sticks with the concepts of be_tls_get_compression(): > - For the backend, this routine returns an allocated string with the > contents of the expected TLS message, and its size: > char *be_tls_get_tls_finish(Port *, int *) > - For the frontend, a routine to get the generated TLS finish message: > char *pgtls_get_tls_finish(PGconn *, int *) Those look pretty reasonable to me and seem to go along with the concepts from the RFC, making them hopefully the right API. > > If that wasn't the case then, for example, it wouldn't be possible to do > > channel binding with a LibNSS client and an OpenSSL server or with other > > combinations and I find that rather hard to believe. >=20 > As far as I can see, Windows has some APIs to get the TLS finish message: > https://msdn.microsoft.com/en-us/library/windows/desktop/aa382420(v=3Dvs.= 85).aspx Good. > On macos though it is another story, I am not seeing anything: > https://developer.apple.com/reference/security/secure_transport#symbols That's a bit unfortunate, if that's the case. Perhaps Apple will see fit to address that deficiency though. > Depending on the SSL implementation the server is compiled with, it > will be up to the backend to decide if it should advertise to the > client the -PLUS mechanism or not, so we can stay modular here. Right, of course. All-in-all, this sounds like it's heading in the right direction, at least at a high level. Glad to see that there's been consideration of other TLS implementations, and as such I don't think we need to be overly concerned about the specifics of the OpenSSL API here. Thanks! Stephen --td4qgJ5lbWoVlCUd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJZLaU0AAoJEO1sijiDR2RVikAP/RCF0aEX1wlx4qc1Bi4BHmrn KLsUaUzKcZrW8r1NJlrXnH3VeX0uHyt8NoNZcRpGto3avY5cOo8VxmqBYJDYAR0W anmRrUjKmG95uSAEi6DWge7Lgo4v7ncig6Lb6g1bfuAaBrleKBHrggUxqOeCFoj2 jSVb3oCR0oIAhRNbaNsLFgDwiDwWkvh4BxHXOfzgDnGwdWUJGzHPvMEBjXm7oC+n cT49t55ZJCR2mPqjcnEurkLv7s+pR8qhbayNRX3lL0FxtLH2a4/wJ9VwutLI1lh1 XDuU+f+Et/KkNNUxVJO3cLlCCLwCGoCwSDZzlSZX+bJ7bg1l8Jl0TTPlIV9iQNBR 1B0o4dxusL5AQprDMZgbdP8miC8F1idpvP4OmNa5LNKR646YTDsRQ7nw33Ob1OmJ EjVord373AC6Zy/MvmUbNONGdlnXsUq2EPJLZ1MXB+F7qmRQVJWkBBjD+jgBWBhU jpkn6WS5HvD3ZJQc1ohxfGoMJMU6XQC4kiW2Dm1ixSGBnH8b0TGmjDV511B8vCRI 7wmGP3e+mtBXzN2Cn2NQMrLFzg5zKRi0JLaGoLAyU22fzD1hvDHdQG6QxZyxW1s9 s/YdXbYsZUQKlbp/34k7yOZqJQ1FsSODdec6iKH/llopxwhpsRy43CoSRiqez9/D eRC1YJDET1oKDZlNzT8b =jOai -----END PGP SIGNATURE----- --td4qgJ5lbWoVlCUd--