pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Hernández Tortosa <aht@8kdata.com>
To: Michael Paquier <michael.paquier@gmail.com>
To: Stephen Frost <sfrost@snowman.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: PostgreSQL JDBC List <pgsql-jdbc@postgresql.org>
Subject: Re: [JDBC] Channel binding support for SCRAM-SHA-256
Date: Tue, 20 Jun 2017 21:04:24 +0200
Message-ID: <b73a4aab-49cf-189b-1c15-af25dc8d964a@8kdata.com> (raw)
In-Reply-To: <CAB7nPqTRUji5Lz8Rwg0MV9yYV8VQHbkCqG6Gmi36Dw+U72E7Ng@mail.gmail.com>
References: <20170530151432.GW3151@tamriel.snowman.net>
	<CAB7nPqQx+A9gYeQz20XS1roje0BwY3MS=3gN0UbOQFiPi_Uzxw@mail.gmail.com>
	<20170530170036.GZ3151@tamriel.snowman.net>
	<CA+TgmoY66SofTi87W-X6OgK6DzfVO2RhQr91Ley5dzg-JgYfTw@mail.gmail.com>
	<20170531034941.GH3151@tamriel.snowman.net>
	<CA+TgmoZ_RVwKjLCJzCdv-_QpxrQZOSGipXBwT_iX5kpNHbT1_g@mail.gmail.com>
	<20170531235922.GR3151@tamriel.snowman.net>
	<CA+TgmoaVZuuOqnKGiB4oMF8kWsohEQF1jMgfy4b=-mPzoq0kdQ@mail.gmail.com>
	<20170601155042.GG3151@tamriel.snowman.net>
	<CA+TgmobTz6cftKYsg2xMdFsC=PxGFysbvd06s=NedgMUV8E82w@mail.gmail.com>
	<20170602010826.GP3151@tamriel.snowman.net>
	<CAB7nPqQOFSn-PYpEXawFx5Gh0CSwX6kPR4ib+T5qmd7OVsV=PA@mail.gmail.com>
	<CAB7nPqTRUji5Lz8Rwg0MV9yYV8VQHbkCqG6Gmi36Dw+U72E7Ng@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



On 20/06/17 06:11, Michael Paquier wrote:
> On Tue, Jun 6, 2017 at 3:40 PM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
>> As far as I can see, there are a couple of things that I still need to
>> work on to make people happy:
>> - Rework the generic APIs for TLS finish and endpoint so as any
>> implementation can use channel binding without inducing any extra code
>> footprint to be-secure.c and fe-secure.c.
>> - Implement endpoint, as Alvaro is saying for JDBC that would be nicer.
>> - Have a couple of tests for channel binding to allow people to test
>> the feature easily. Those will be in src/test/ssl/. It would be nice
>> as well to be able to enforce the channel binding type on libpq-side,
>> which is useful at least for testing. So we are going to need an
>> environment variable for this purpose, and a connection parameter.
> Okay, here we go. Attached is a set of four patches:
> - 0001 is some refactoring for the SSL tests so as other test suite in
> src/test/ssl can take advantage of the connection routines. There is
> nothing fancy here.
> - 0002 is the implementation of tls-unique as channel binding. This
> has been largely reworked since last submission, I have found on the
> way a couple of bugs and some correctness issues.
> - 0003 is a patch to add as connection parameters saslname and
> saslchannelbinding. With support of more SASL mechanisms (PG10 has
> SCRAM-SHA-256, I am adding SCRAM-SHA-256-PLUS here), saslname can be
> used to enforce on the client-side the value of the SASL mechanism
> chosen. saslchannelbinding does the same for the channel binding name.
> This is very useful for testing, and a set of tests are added in
> src/test/ssl/ for tls-unique and the SASL mechanisms. The tests cover
> many scenarios, like downgrade attacks for example.
> - 0004 is the implementation of tls-server-end-point, as Alvaro has
> asked. Per RFC 5929, the binding data needs to be a hash of the server
> certificate. If the signature algorithm of the certificate is MD5 or
> SHA-1, then SHA-256 is used. Other signature algos like SHA-384 or 512
> are used to hash the data. The hashed data is then encoded in base64
> and sent to the server for verification. Tests using saslchannelname
> have been added as well. It took me a while to find out that
> OBJ_find_sigid_algs(X509_get_signature_nid(X509*)) needs to be used to
> find out the algorithm of a certificate with OpenSSL.
>
> With the tests directly in the patch, things are easy to run. WIth
> PG10 stabilization work, of course I don't expect much feedback :)
> But this set of patches looks like the direction we want to go so as
> JDBC and libpq users can take advantage of channel binding with SCRAM.

     This is awesome, Michael.

     In the coming weeks, and once my PR for pgjdbc has been added, I 
will work towards another patch to implement channel binding. Should be 
reasonably easy now, thanks to this.

     Appreciated!

     Álvaro



-- 

Álvaro Hernández Tortosa


-----------
<8K>data



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (75+ messages)  latest in thread

Message-ID: <b73a4aab-49cf-189b-1c15-af25dc8d964a@8kdata.com>
Permalink:  ../b73a4aab-49cf-189b-1c15-af25dc8d964a@8kdata.com/
Also on:    postgresql.org/message-id/b73a4aab-49cf-189b-1c15-af25dc8d964a@8kdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: aht@8kdata.com, michael.paquier@gmail.com, sfrost@snowman.net, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: [JDBC] Channel binding support for SCRAM-SHA-256
  In-Reply-To: <b73a4aab-49cf-189b-1c15-af25dc8d964a@8kdata.com>
  References: <20170530151432.GW3151@tamriel.snowman.net> <CAB7nPqQx+A9gYeQz20XS1roje0BwY3MS=3gN0UbOQFiPi_Uzxw@mail.gmail.com> <20170530170036.GZ3151@tamriel.snowman.net> <CA+TgmoY66SofTi87W-X6OgK6DzfVO2RhQr91Ley5dzg-JgYfTw@mail.gmail.com> <20170531034941.GH3151@tamriel.snowman.net> <CA+TgmoZ_RVwKjLCJzCdv-_QpxrQZOSGipXBwT_iX5kpNHbT1_g@mail.gmail.com> <20170531235922.GR3151@tamriel.snowman.net> <CA+TgmoaVZuuOqnKGiB4oMF8kWsohEQF1jMgfy4b=-mPzoq0kdQ@mail.gmail.com> <20170601155042.GG3151@tamriel.snowman.net> <CA+TgmobTz6cftKYsg2xMdFsC=PxGFysbvd06s=NedgMUV8E82w@mail.gmail.com> <20170602010826.GP3151@tamriel.snowman.net> <CAB7nPqQOFSn-PYpEXawFx5Gh0CSwX6kPR4ib+T5qmd7OVsV=PA@mail.gmail.com> <CAB7nPqTRUji5Lz8Rwg0MV9yYV8VQHbkCqG6Gmi36Dw+U72E7Ng@mail.gmail.com> <b73a4aab-49cf-189b-1c15-af25dc8d964a@8kdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox