Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEpRn-00022n-K4 for pgsql-committers@arkaria.postgresql.org; Mon, 30 Sep 2019 06:46:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iEpRl-0007S5-7K for pgsql-committers@arkaria.postgresql.org; Mon, 30 Sep 2019 06:46:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEpRj-0007RW-MC for pgsql-committers@lists.postgresql.org; Mon, 30 Sep 2019 06:46:13 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iEpRK-0005kC-7D for pgsql-committers@lists.postgresql.org; Mon, 30 Sep 2019 06:46:10 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A66F521B34; Mon, 30 Sep 2019 02:45:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 30 Sep 2019 02:45:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=aCJSdtsiJOGM56h5dFnRtksDqfs wg9pKiwVOi4XsDjw=; b=Oy9Pt/Z4SLZt6Y1K9frVkTGHCu+YT6vV1MKJNYMPycA EALl7Lg1v8Y7HZWXbK5605EKS2FejJXLWCH1pqib0d46d1jHFE94fMa4k1JEYKkM W97E918xC946vwe3dHpBpedePDd6tFREIVXIiz1S3QJwLaAXEOHDkfcyIa0Ziy8s vwAKVOh5Kcvr9oXJSCJtW1kKdLYJ6XwzmvPtwYL1TyVZ79SfwgzrFLKxMmztKUlz NjiRdjcgSPN2WdM1LZIPZdRnUm6gIpmgN5cYGq10mZEfmnM+ADtXXGSHwPOGqN2i pwSHFid33yNVCk3hVPGWjmZQqhy8ziu7Z/zx+HhX6xA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=aCJSdt siJOGM56h5dFnRtksDqfswg9pKiwVOi4XsDjw=; b=CiqsECanxn7mt8BAEZWCgE sduUvKFdZ0vcLfKDfJRnUhnbjtZhFFK1evUNWOnYSFGvTt0JLEQDwTSPr4igzUQT FPptaktdA9d6Cn8mU+2UY/ABbBZVnb8rDZUs0MFhBOwcbVuwA1oMslnIaZRU+fii 3sUlZ4xNyK+yxfucFbN75QdycDlIiMwNrjJcIWHPclDrFxZ8cKMclir69G8yTt3b LeLz9xQxHDRdALV7h59b5Y17kRWFTxGL39HUoqjFroAoa36PiTlztPWqcctOvRb0 kaTk8StdiCD5hyIwJlj5xKDN5JetnzL6Bl7v8BQEyjfiuLJX8FV/uIp5Hr/rGzYQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrgedugdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepudduuddruddtvddrudektddrudekheenucfrrghr rghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id D40D48005A; Mon, 30 Sep 2019 02:45:42 -0400 (EDT) Date: Mon, 30 Sep 2019 15:45:39 +0900 From: Michael Paquier To: Tom Lane Cc: Jeff Davis , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Add libpq parameter 'channel_binding'. Message-ID: <20190930064539.GK2888@paquier.xyz> References: <24857.1569775891@sss.pgh.pa.us> <20190929234733.GA2888@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5LiOUhUlsRX0HDkW" Content-Disposition: inline In-Reply-To: <20190929234733.GA2888@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --5LiOUhUlsRX0HDkW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 30, 2019 at 08:47:33AM +0900, Michael Paquier wrote: > On Sun, Sep 29, 2019 at 12:51:31PM -0400, Tom Lane wrote: >> Another point is that this error message is misleading --- or at least >> would be misleading if the server had X509_get_signature_nid and the >> client didn't. >> >> -#ifdef HAVE_PGTLS_GET_PEER_CERTIFICATE_HASH >> if (conn->channel_binding[0] !=3D 'd') /* disable */ >> + { >> +#ifdef HAVE_PGTLS_GET_PEER_CERTIFICATE_HASH >> selected_mechanism =3D SCRAM_SHA_256_PLUS_NAME; >> +#else >> + printfPQExpBuffer(&conn->errorMessage, >> + libpq_gettext("client does not sup= port SCRAM-SHA-256-PLUS authentication\n")); >> + goto error; >> + } >> #endif >> } >=20 > Yes, it looks sensible to do that. If the server publishes SCRAM-SHA-256-PLUS and the server does not support channel binding, then we get this error message: "channel binding is required, but server did not offer an authentication method that supports channel binding." So that's the part which is wrong. Now, I am not completely sure that the suggested change is completely right either as we would get an error in this scenario when channel_binding is "prefer" or "require". For "require", this error message is fine. However, for "prefer", shouldn't we do what we do on HEAD, aka *not* select SCRAM-SHA-256-PLUS and switch to SCRAM-SHA-256? This would have the advantage to make the connection work with default parameters. -- Michael --5LiOUhUlsRX0HDkW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl2RpJMACgkQnvQgOdby QH3khA/+NmkGoCBHIAqzORBC7J1RHE5cXYqtmFKJCKTg1DlavKLv2Ax+cIGHKmdw QQq75XrPW9nzXYAvkKz1RBxelgjoIRVQ2SqUHmV8cms65mzVkLSTH/gi7aL2tSwn Wp4DRrmZsY+8rLpM7j4I1qSmAE/RFMl59xECYFU6TFg066JbrOrrXJA78evgZziI oBTLlTTh2eqpXf6fRlXod8g3WR6/Gc92v6eEEy/NPT9r7Z4q6oBGetF4J5KtXOXT 0CmbtUN5+fYjtZ7AkfRO5KxzvvqAvl69EbnCTMCthOR4f/xxN1qqmevNtToirocm ubgTAGJ/xlf2mCSSlSFVpWknk2kGgICFxl90AkN9dtsVEaUleNXjamqW7g7IPmn0 KJyw9CFw/YsE3ga7VyxUuPkOFFcjVcNvyT42mH04e6kImRQbIpx4IXjgdvDI8NwE GXJrBkKtwEygCPaPM+aTFR+1K687pOINOVdH6g+IDWsSrABRHhUl7zvyD/zX35Vr C655OpzbPAQDOfAL+jlCNBUAhE80S3NUsZPFxF4XVqgWjoogpzy35P7HiTSwDtqY cB/p39DBJyJZOPQgJHTJeW8GpdDlfnGxBQ6DX0AAUAKOF3Agkkhd8VbPUvBnuirp DD7AieLY117Pb3VtfDMXTl9UKFgsmpVqKqA+PtPc3b0/EEfxh2k= =AWZn -----END PGP SIGNATURE----- --5LiOUhUlsRX0HDkW--