Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4D5N-0006EO-Lk for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Dec 2022 03:33:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p4D5K-0003se-Tt for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Dec 2022 03:33:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4D5J-0003sU-7M for pgsql-hackers@lists.postgresql.org; Sun, 11 Dec 2022 03:33:02 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p4D59-0005RV-04 for pgsql-hackers@lists.postgresql.org; Sun, 11 Dec 2022 03:32:58 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 58DD35C007F; Sat, 10 Dec 2022 22:32:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 10 Dec 2022 22:32:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1670729568; x=1670815968; bh=VXwMFhROxv SBnsQEsnswgtnkYd9YFnkBbDzVY130t1U=; b=LokWCKdpWOlAT48NkzrO2iThRR AMC9kjYEGrvW3BHxjYanTI6I4tyeXf2uMx9X68mQeftNmNnIMX+dpeDjLHDjJzwu XG6Hk1WFivXATPpC3c4FeN0sKrXUt7KZBSoY8/iIa83LQDpWjfkWxSOM+aVzrrat 3sOc95TYmdp25TsACWiFxAz+R1tKR6MLbw3FwfZNHZby8KjBZP9o/vrVMfpEcJT1 8hmBvvsYhMcZjTXUGUVhPYs9sVp0AD4m1CKwVLXyd5uQHxevea7xhIGTWj0LgQQE 4RcK+2t73g7ajRs5h6hapmUGzTlAKLckzXlW+TZP499j21U2Rm8YPmDTLEVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1670729568; x=1670815968; bh=VXwMFhROxvSBnsQEsnswgtnkYd9Y FnkBbDzVY130t1U=; b=IgWgPKWZsb17eqX3Dmzz/MHdj5uAVAr934DFaJMw5MT8 +lrkC1nAAtLYMKDhkVGNCzhz9WeF9EZd3aQ5mBn2K1IwdkBHK3vGoWJ9H7Bbx4Ia Qo32+QFp0Eu9tiLYpwEiat81EsbWQbLeLY89ia2mPHRBzEJvguzHo9SoIPwkI6cg YEcIazHfwdFB/7Rpi8XFtGPaBKBOQNPjhGL9Ap1SB9aHzGXq11J0CnRc0B8SPB0z kBjlhLkAQqC465Xmxh+fwbH6DDkFhWiBB9u8d4TgePg865/4OWER7r3mrxP1pcCc UuYaOzF4Y5NGKUuAqSGRF1q3hvgnL2Pz7fzpSN1m/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehgdeiudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 10 Dec 2022 22:32:46 -0500 (EST) Date: Sun, 11 Dec 2022 12:32:38 +0900 From: Michael Paquier To: Daniel Gustafsson Cc: Andres Freund , PostgreSQL Hackers Subject: Re: Raising the SCRAM iteration count Message-ID: References: <20221210001538.czikyvk3xtkphxfu@awork3.anarazel.de> <4E147E88-76CF-4E54-B8CE-B4FE1AD40CF5@yesql.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yZw5PXQ0FGPIA1v9" Content-Disposition: inline In-Reply-To: <4E147E88-76CF-4E54-B8CE-B4FE1AD40CF5@yesql.se> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --yZw5PXQ0FGPIA1v9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 11, 2022 at 12:46:23AM +0100, Daniel Gustafsson wrote: > SCRAM with an iteration count of 1 still provides a lot of benefits over = md5, > so if we can make those comparable in performance then that could be a way > forward (with the tradeoffs properly documented). Okay, it looks like there is a wish to make that configurable anyway, and I have a few comments about that. {"scram_iteration_count", PGC_SUSET, CONN_AUTH_AUTH, + gettext_noop("Sets the iteration count for SCRAM secret generat= ion."), + NULL, + GUC_NOT_IN_SAMPLE | GUC_SUPERUSER_ONLY + }, Shouldn't this be user-settable as a PGC_USERSET rather than PGC_SUSET which would limit its updates to superusers? As shaped, the GUC would not benefit to \password, and we should not encourage users to give a raw password over the wire if possible if they wish to compute a verifier with a given interation number. Hence, wouldn't it be better to mark it as GUC_REPORT, and store its=20 status in pg_conn@libpq-int.h in the same fashion as default_transaction_read_only and hot_standby? This way, PQencryptPasswordConn() would be able to feed on it automatically rather than always assume the default implied by pg_fe_scram_build_secret(). -- Michael --yZw5PXQ0FGPIA1v9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmOVT1YACgkQnvQgOdby QH3GHg//YuRu328AtI+tiJQlLV+jp23SLAc7lm/K7Krabkq1PW2EzKyfbg9xd7X2 TXIu9O5UIO6TING1aisBFmv3gNPbdh9ZVBvUDcc2YvQv087RKzWNVE79bEQqZCmp frNDRwxkWWbNDJhMMvdiYdETr8aZ7PIWuFQce6dX6gn2bM2ftP7E7sP8gjmUMN3H eoLw0XOvKliWrYf26JBtIK5u4E0Oz+OWBbnP/AXaapR+gJlsn8RX8/2IcH2PgTZ7 +8D3lP+LyyuBbkjJy3X+jIE2UO4Jv0YTPK164Ep+R4yULKH2p5ZyoAvJdrRsCHRB +tL+cDpsHNQji/9SzWHJaRjFP0nAjyh/Mpj75aLVxPmaBpWML5QqxtccAOPagzLU RXB/2tkMK0cVxbg68Z6Bs/VeJB4uOcp40fYkalQ4IxI8HMSQUjJEbAMhMo+JrQdd v0JQV0iOkh7VpxzoeDZ3MpsC3Uwrn9Qo7ruUCHNjalAUAcJdxX13R9di6uwjwdqa U23mNtjrtIATnWwEP2Dmc0pzCDH3ltLvvVVLV4tbJk84TVOEC+3faouvAYBRXIoK 3olezMDDOfnlREplUCLwH7IkWVE1ARvATXtZEkea5ptcSPaB20iKiD90kvdNhr53 /+VkfaeUFi2rx2BWRgkl/wKWTw6TM1Y6I7qfVlgYLWnPMvQ0PMk= =QPEY -----END PGP SIGNATURE----- --yZw5PXQ0FGPIA1v9--