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 1hvv8r-0000wd-6k for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Aug 2019 03:00:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hvv8o-00046e-9z for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Aug 2019 03:00:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvv8o-00046L-0i for pgsql-hackers@lists.postgresql.org; Fri, 09 Aug 2019 03:00:30 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvv8l-00006U-Ar for pgsql-hackers@postgresql.org; Fri, 09 Aug 2019 03:00:29 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3AC332210D; Thu, 8 Aug 2019 23:00:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 08 Aug 2019 23:00:26 -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=30oIw2dzcTd6p5fl4h7S3Rm3xWz tAZw3hhiQ52hXTvQ=; b=sPxxn9dzLrfrfSAzyj5qILGi8YjIaX3l7B7w0mmtFBZ ChEi9+TioGePCvfxq/bZcb+EliBB1buL3ra7DUfzOqoHegA3lEeDZSsCT7rHPOia urRQ6eLbmUeHN3CWvdiyC29BUXiYegpDt+HbtNyUFt0gSJiJHvrUZv3UbRjPi3rD HRHxN650LwkXyUBCsXvOsK7+FbNsZ6Ic2afzBByf9dfv6TQghxdt2CBI8YSZd9gw +Vd/DYZFd5feilm8jMZF6YrzGkA6cHkjZpi3VF5tbxsa0wcZ7lUzsiEP/8sO1LDV T4GiIPbkPC4637XJsZMMXevLAQWikuvd7JscHP5oE5w== 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=30oIw2 dzcTd6p5fl4h7S3Rm3xWztAZw3hhiQ52hXTvQ=; b=L4504Pm2zBtE9sPBu5wmm8 oLqp4dm4+9ZnDAOM0qu4bwDHjlRtPJ2t7phmWY6y/yKrB78wWXGW24FzIwZfX84j KvjY1001zIEFOUOQqMwu/XVNSzASb5iaqkUFDVtZoeCCYLlwzlBtRg3/+jYGv55f +ZWyZCrrUkbgdcf7lsBEhdF78hYhejmeleu1Gw82AoSoA+uINylhN+hJ10OF70Ox p3oO8pA0D4hon2dACpBNUCCrQ+AhqWn3drBfjVVBcABnfiXQ6Vur3p/JejfpOEXn eE7v195Ge315djLMAsZPf9MyFfxbZxKQEMi7eOnCkUwX8qD5QdUvXuEl0uHMI6NA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudduiedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucfkphepuddukedrvd eguddrvdegkedrudegheenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (mp76f1f891.ap.nuro.jp [118.241.248.145]) by mail.messagingengine.com (Postfix) with ESMTPA id 55D3E80062; Thu, 8 Aug 2019 23:00:24 -0400 (EDT) Date: Fri, 9 Aug 2019 12:00:21 +0900 From: Michael Paquier To: Jeff Davis Cc: pgsql-hackers@postgresql.org Subject: Re: Add "password_protocol" connection parameter to libpq Message-ID: <20190809030021.GG3194@paquier.xyz> References: <227015d8417f2b4fef03f8966dbfa5cbcc4f44da.camel@j-davis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9Iq5ULCa7nGtWwZS" Content-Disposition: inline In-Reply-To: <227015d8417f2b4fef03f8966dbfa5cbcc4f44da.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --9Iq5ULCa7nGtWwZS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 08, 2019 at 03:38:20PM -0700, Jeff Davis wrote: > Libpq doesn't have a way to control which password protocols are used. > For example, the client might expect the server to be using SCRAM, but > it actually ends up using plain password authentication instead. Thanks for working on this! > I'm not 100% happy with the name "password_protocol", but other names I > could think of seemed likely to cause confusion. What about auth_protocol then? It seems to me that it could be useful to have the restriction on AUTH_REQ_MD5 as well. > Sets the least-secure password protocol allowable when using password > authentication. Options are: "plaintext", "md5", "scram-sha-256", or > "scram-sha-256-plus". This makes it sound like there is a linear hierarchy among all those protocols, which is true in this case, but if the list of supported protocols is extended in the future it may be not. I think that this should have TAP tests in src/test/authentication/ so as we make sure of the semantics. For the channel-binding part, the logic path for the test would be src/test/ssl. +#define DefaultPasswordProtocol "plaintext" I think that we are going to need another default value for that, like "all" to reduce the confusion that SCRAM, MD5 and co are still included in the authorized set in this case. Another thing that was discussed on the topic would be to allow a list of authorized protocols instead. I personally don't think that we need to go necessarily this way, but it could make the integration of things line scram-sha-256,scram-sha-256-plus easier to integrate in application flows. -- Michael --9Iq5ULCa7nGtWwZS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl1M4cUACgkQnvQgOdby QH1OvBAAoVOaEaw6N4ptF87Oz59q/uIRjmlDcyCTRFEPs+mXbjj5G7/9VcU3kGt6 nQuzJb3jUCgCumiQSdSy0Q9XYPKchrZj/bPW7iksOh3cT2k4CZiA7iwcrOJjJZmz fZXqlozegCHJCRMZTeX56K8bzYzozPrmsxixQy6lHTapUaU3s27Fxu3qmyZgL82Q pFcIb5MR3IbrZqNN5u3LWQDxVWFSNCo0vUyM9Xe1CqyEEqxFBWMns3VasJ70Vsaq h77HQSHuo4pjQFNiHEdbboZOqqJJ0Sxwi5Qrl8XZc0oS9EOgt9G7lJYt1e07VzzU 7amCaWKvlL5Ikxy1G1xTYbLC+B7P5fB5P2+gbVExAI+6HZg10pIbamRmtmNXO53h 0F0jVwsQjNhBWBV2gKkSiApzidUBBooqIm7mwoTQe+ZtWzFfaHzWdHsrC9qCRYUT 8rnzkM2ffV8B/eHuefKNUsbQt8h85e/PSXUUiZNv16AxXRxEEa+HPbVlMxop+CQq DQZuEZRrOlg3zjdTO0kTRcqko8hxw3PZER2LSfCTSUJwgpMgx2WivrrM840kQQa3 qeDgiCxK07eBcQztz8IXhIiCBlMsufrLz6/a0fFcreei2+CP2aWSVkDSIc6mu4d7 yONABEwSQ6MRcG7kao4O8Rh8MZtsgsehnCaPwfkrm4cfY39Shcw= =qsel -----END PGP SIGNATURE----- --9Iq5ULCa7nGtWwZS--