pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Hernández Tortosa <aht@8kdata.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Some thoughts about SCRAM implementation
Date: Wed, 12 Apr 2017 19:14:39 +0200
Message-ID: <96912a79-a7a8-14bb-bd88-9044f1af637c@8kdata.com> (raw)
In-Reply-To: <8328.1492013344@sss.pgh.pa.us>
References: <df8c6e27-4d8e-5281-96e5-131a4e638fc8@8kdata.com>
	<a990783c-44b3-cff6-7128-c6393be41af6@iki.fi>
	<729b548a-f434-f31c-15e7-59f44aaecc8d@8kdata.com>
	<20170410183230.oxagjpfgj6xxmcwx@alap3.anarazel.de>
	<fd4530e0-f016-4eb9-a0d0-e32824482db5@8kdata.com>
	<20170412004118.GC20340@momjian.us>
	<20170412005830.GU9812@tamriel.snowman.net>
	<20170412012532.GF20340@momjian.us>
	<CABUevEwJO6QNmZVzARPf-nePv07ne1R=o73VQ2Oq6cn_+beJ_w@mail.gmail.com>
	<ee93b36d-59d2-35e6-dd0c-fb7c9cc65e0c@iki.fi>
	<20170412152629.GI20340@momjian.us>
	<20a91441-fa4c-ec2c-d813-c549066b8055@iki.fi>
	<8328.1492013344@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



On 12/04/17 18:09, Tom Lane wrote:
> Heikki Linnakangas <hlinnaka@iki.fi> writes:
>> On 04/12/2017 06:26 PM, Bruce Momjian wrote:
>>> How does it do that?
>> Good question, crypto magic? I don't know the details, but the basic
>> idea is that you extract a blob of data that uniquely identifies the TLS
>> connection. Using some OpenSSL functions, in this case. I think it's a
>> hash of some of the TLS handshake messages that were used when the TLS
>> connection was established (that's what "tls-unique" means). That data
>> is then incorporated in the hash calculations of the SCRAM
>> authentication. If the client and the server are not speaking over the
>> same TLS connection, they will use different values for the TLS data,
>> and the SCRAM computations will not match, and you get an authentication
>> failure.

     I believe the above is not correct. Channel binding data is *not* 
used for any hash computations. It is simply a byte array that is 
received as an extra user parameter, and the server then gets it by its 
own way (its own TLS data) and do a byte comparison. That's what the 
RFCs say about it.
> ... which the user can't tell apart from having fat-fingered the password,
> I suppose?  Doesn't sound terribly friendly.  A report of a certificate
> mismatch is far more likely to lead people to realize there's a MITM.

     So given what I said before, that won't happen. Indeed, SCRAM RFC 
contains a specific error code for this: "channel-bindings-dont-match".


     Á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 (34+ messages)  latest in thread

Message-ID: <96912a79-a7a8-14bb-bd88-9044f1af637c@8kdata.com>
Permalink:  ../96912a79-a7a8-14bb-bd88-9044f1af637c@8kdata.com/
Also on:    postgresql.org/message-id/96912a79-a7a8-14bb-bd88-9044f1af637c@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: aht@8kdata.com, tgl@sss.pgh.pa.us, hlinnaka@iki.fi, bruce@momjian.us, magnus@hagander.net, sfrost@snowman.net, andres@anarazel.de
  Subject: Re: Some thoughts about SCRAM implementation
  In-Reply-To: <96912a79-a7a8-14bb-bd88-9044f1af637c@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