Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyKpk-0002TW-Ud for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2017 16:09:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cyKpk-00011R-8d for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Apr 2017 16:09:28 +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 1cyKpi-00010e-NM for pgsql-hackers@postgresql.org; Wed, 12 Apr 2017 16:09:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cyKpg-00005A-0y for pgsql-hackers@postgresql.org; Wed, 12 Apr 2017 16:09:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v3CG94pJ008329; Wed, 12 Apr 2017 12:09:04 -0400 From: Tom Lane To: Heikki Linnakangas cc: Bruce Momjian , Magnus Hagander , Stephen Frost , =?UTF-8?Q?=c3=81lvaro_Hern=c3=a1ndez_Tortosa?= , Andres Freund , pgsql-hackers Subject: Re: Some thoughts about SCRAM implementation In-reply-to: <20a91441-fa4c-ec2c-d813-c549066b8055@iki.fi> References: <729b548a-f434-f31c-15e7-59f44aaecc8d@8kdata.com> <20170410183230.oxagjpfgj6xxmcwx@alap3.anarazel.de> <20170412004118.GC20340@momjian.us> <20170412005830.GU9812@tamriel.snowman.net> <20170412012532.GF20340@momjian.us> <20170412152629.GI20340@momjian.us> <20a91441-fa4c-ec2c-d813-c549066b8055@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Wed, 12 Apr 2017 18:55:58 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8327.1492013344.1@sss.pgh.pa.us> Date: Wed, 12 Apr 2017 12:09:04 -0400 Message-ID: <8328.1492013344@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Heikki Linnakangas 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. ... 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 this seems more like a hack than like a feature we need so desperately as to push it into v10 post-freeze. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers