pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Álvaro Hernández Tortosa <aht@8kdata.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256
Date: Sat, 18 Nov 2017 10:56:23 -0500
Message-ID: <b657ef4c-ce91-7a11-039b-7d97cd950289@2ndquadrant.com> (raw)
In-Reply-To: <CAB7nPqQiYEXthThDY8+ye=B-zYam7cE+daFYPOmY8hwVSZxGjw@mail.gmail.com>
References: <20170530151432.GW3151@tamriel.snowman.net>
	<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>
	<CAB7nPqT5ov4roTKdvAAq4UhJ=QFeNT6QfmFjx4osY6x3MTf_zA@mail.gmail.com>
	<CAB7nPqRnemzvQ_-o3D9Y=6E+uSYnvj_aqLR1Z-QhC3Fk1K=W2A@mail.gmail.com>
	<f74525e4-6c53-c653-6860-a8cc8d7c8ad9@2ndquadrant.com>
	<CAB7nPqS5o3__QE2NGqYRoQDKoiWYxzst55hi9JWWU6iBVaPAbw@mail.gmail.com>
	<CAB7nPqTdWXvMOGGyPD4dsgcTB6sTCLUf9G+emD_oM2FuJ72KFA@mail.gmail.com>
	<CAB7nPqQbxmAB1_1twHHnEYfvdCvFetb=A+MSJvpjrCL-56jycA@mail.gmail.com>
	<7fe055c6-0885-833b-054d-124e3c3acdf9@2ndquadrant.com>
	<CAB7nPqR0gdahOGJPnsuZv5tMeX+AbwrvRF1CXofqqk94aRrN+Q@mail.gmail.com>
	<887b6fb7-15fe-239e-2aad-5911d2b0945b@2ndquadrant.com>
	<CAB7nPqQiYEXthThDY8+ye=B-zYam7cE+daFYPOmY8hwVSZxGjw@mail.gmail.com>

On 11/18/17 06:32, Michael Paquier wrote:
> Here are some comments.
> 
> +            * The client requires channel biding.  Channel binding type
> s/biding/binding/.

fixed

>                 if (!state->ssl_in_use)
> +                   /*
> +                    * Without SSL, we don't support channel binding.
> +                    *
> Better to add brackets if adding a comment.

done

> +                * Read value provided by client; only tls-unique is supported
> +                * for now.  XXX Not sure whether it would be safe to print
> +                * the name of an unsupported binding type in the error
> +                * message.  Pranksters could print arbitrary strings into the
> +                * log that way.
> That's why I didn't show those strings in the error messages of the
> previous versions. Those are useless as well, except for debugging the
> feature and the protocol.

Right.  I left the comment in there as a note to future hackers who want
to improve error messages (often myself).

> +       cbind_header_len = 4 + strlen(state->channel_binding_type); /*
> p=type,, */
> +       cbind_input_len = cbind_header_len + cbind_data_len;
> +       cbind_input = malloc(cbind_input_len);
> +       if (!cbind_input)
> +           goto oom_error;
> +       snprintf(cbind_input, cbind_input_len, "p=%s",
> state->channel_binding_type);
> +       memcpy(cbind_input + cbind_header_len, cbind_data, cbind_data_len);
> By looking at RFC5802, a base64 encoding of cbind-input is used:
> cbind-input   = gs2-header [ cbind-data ]
> gs2-cbind-flag "," [ authzid ] ","
> However you are missing two commands after p=%s, no?

fixed

I have committed the patch with the above fixes.

I'll be off for a week, so perhaps by that time you could make a rebased
version of the rest?  I'm not sure how much more time I'll have, so
maybe it will end up being moved to the next CF.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (75+ messages)  latest in thread

Message-ID: <b657ef4c-ce91-7a11-039b-7d97cd950289@2ndquadrant.com>
Permalink:  ../b657ef4c-ce91-7a11-039b-7d97cd950289@2ndquadrant.com/
Also on:    postgresql.org/message-id/b657ef4c-ce91-7a11-039b-7d97cd950289@2ndquadrant.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: peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com, aht@8kdata.com, pgsql-hackers@postgresql.org
  Subject: Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256
  In-Reply-To: <b657ef4c-ce91-7a11-039b-7d97cd950289@2ndquadrant.com>
  References: <20170530151432.GW3151@tamriel.snowman.net> <20170602010826.GP3151@tamriel.snowman.net> <CAB7nPqQOFSn-PYpEXawFx5Gh0CSwX6kPR4ib+T5qmd7OVsV=PA@mail.gmail.com> <CAB7nPqTRUji5Lz8Rwg0MV9yYV8VQHbkCqG6Gmi36Dw+U72E7Ng@mail.gmail.com> <CAB7nPqT5ov4roTKdvAAq4UhJ=QFeNT6QfmFjx4osY6x3MTf_zA@mail.gmail.com> <CAB7nPqRnemzvQ_-o3D9Y=6E+uSYnvj_aqLR1Z-QhC3Fk1K=W2A@mail.gmail.com> <f74525e4-6c53-c653-6860-a8cc8d7c8ad9@2ndquadrant.com> <CAB7nPqS5o3__QE2NGqYRoQDKoiWYxzst55hi9JWWU6iBVaPAbw@mail.gmail.com> <CAB7nPqTdWXvMOGGyPD4dsgcTB6sTCLUf9G+emD_oM2FuJ72KFA@mail.gmail.com> <CAB7nPqQbxmAB1_1twHHnEYfvdCvFetb=A+MSJvpjrCL-56jycA@mail.gmail.com> <7fe055c6-0885-833b-054d-124e3c3acdf9@2ndquadrant.com> <CAB7nPqR0gdahOGJPnsuZv5tMeX+AbwrvRF1CXofqqk94aRrN+Q@mail.gmail.com> <887b6fb7-15fe-239e-2aad-5911d2b0945b@2ndquadrant.com> <CAB7nPqQiYEXthThDY8+ye=B-zYam7cE+daFYPOmY8hwVSZxGjw@mail.gmail.com> <b657ef4c-ce91-7a11-039b-7d97cd950289@2ndquadrant.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