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 1p6NrV-0006Dp-Dn for pgsql-hackers@arkaria.postgresql.org; Sat, 17 Dec 2022 03:27:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p6NrT-00081N-6k for pgsql-hackers@arkaria.postgresql.org; Sat, 17 Dec 2022 03:27:43 +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 1p6NrS-00081E-Tw for pgsql-hackers@lists.postgresql.org; Sat, 17 Dec 2022 03:27:42 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6NrM-0000oX-7f for pgsql-hackers@lists.postgresql.org; Sat, 17 Dec 2022 03:27:42 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 371085C009E; Fri, 16 Dec 2022 22:27:35 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 16 Dec 2022 22:27:35 -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=1671247655; x=1671334055; bh=jujXpboOgv d3bA6IlVAt+8dc1Rra/m/CyLVXe58Ngpo=; b=fzxNnX7Jjpe0t1v0+d33YXnzz9 VS7lbgWBFoZ5+iY6IYK6TUZWajLZwLVai+yTgljW6XjmZsLhxmJwyPBdoU76yEtX ATT1h5UabBiXEUfLRf/PvCk1EmgA4FYf/OPtyUMuu5PSn3TVvN0xcgT6duALG8to yXp3F/kh0JjQC3p3/Arob/WPpRlDs7ILG9eyjV63p1qGZ/m+WJT2apz7SFCYNc9N T3xEmjEkilcfSfHKketjigt72tlV1w6a01MNZ8TG7HsgAmospI3FOci4pzbq6HJH uKweZnOsBWS1dzDHXD8ba3fES/LgDOABFt7CnFd6Xbf9thWgaxfiBOk9+5ZA== 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=1671247655; x=1671334055; bh=jujXpboOgvd3bA6IlVAt+8dc1Rra /m/CyLVXe58Ngpo=; b=j3W+xfcNcABN7gvPIOtNDtNRVJUzA4/oKUcW8+GT9gNS rrdcwvxx3N465K7UIjw9n/IpyHeaT9eKza4LlMLxfGHI9jNdYgs38QcrHhnPHawH kZFrwZ1CT9lXxZB52JzVKaEpjngCcnHW+y1jrdAjczMkJxp7lL4pvgDDNlu9qr9d D1GHyGWUMm102/kUBPf4fdaH2dr7EGz9CkIg6s/jcrx+JWBe4DSlAi2Q7dCZmflc X9lbuXfOwxW6WnsnCZzSjmp5a1B9BWGRUCRRtja6zJ3JeTCOcGbDFZlsOVqumtHN SnvzAPyZVlnylceKw1vUeygHWB3vHQ67/V23s/tSpg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekgdehiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 16 Dec 2022 22:27:32 -0500 (EST) Date: Sat, 17 Dec 2022 12:27:30 +0900 From: Michael Paquier To: Daniel Gustafsson Cc: "Jonathan S. Katz" , Andres Freund , PostgreSQL Hackers Subject: Re: Raising the SCRAM iteration count Message-ID: References: <20221210001538.czikyvk3xtkphxfu@awork3.anarazel.de> <4880738a-cbf7-c9a1-4faf-ba861c731c63@postgresql.org> <75619A47-4CD0-4E0F-8A30-32F83FF593DD@yesql.se> <869f3aee-5c46-998d-be42-b3b232415bef@postgresql.org> <1D275A6B-EAE5-4C5E-B223-32C28AB79E36@yesql.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zuSA3iHrWub3mXD+" Content-Disposition: inline In-Reply-To: <1D275A6B-EAE5-4C5E-B223-32C28AB79E36@yesql.se> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --zuSA3iHrWub3mXD+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 15, 2022 at 12:09:15PM +0100, Daniel Gustafsson wrote: >> On 15 Dec 2022, at 00:52, Michael Paquier wrote: >> conn->in_hot_standby =3D PG_BOOL_UNKNOWN; >> + conn->scram_iterations =3D SCRAM_DEFAULT_ITERATIONS; >>=20 >> s/SCRAM_DEFAULT_ITERATIONS/SCRAM_SHA_256_DEFAULT_ITERATIONS/ and >> s/scram_iterations/scram_sha_256_interations/ perhaps? =20 >=20 > Distinct members in the conn object is only of interest if there is a way= for > the user to select a different password method in \password right? I can > rename it now but I think doing too much here is premature, awaiting work= on > \password (should that materialize) seems reasonable no? You could do that already, somewhat indirectly, with password_encryption, assuming that it supports more than one mode whose password build is influenced by it. If you wish to keep it named this way, this is no big deal for me either way, so feel free to use what you think is best based on the state of HEAD. I think that I'd value more the consistency with the backend in terms of naming, though. >> @@ -692,7 +697,7 @@ mock_scram_secret(const char *username, int *iterati= ons, char **salt, >> encoded_salt[encoded_len] =3D '\0'; >>=20 >> *salt =3D encoded_salt; >> - *iterations =3D SCRAM_DEFAULT_ITERATIONS; >> + *iterations =3D scram_sha256_iterations; >>=20 >> This looks incorrect to me? The mock authentication is here to >> produce a realistic verifier, still it will fail. It seems to me that >> we'd better stick to the default in all the cases. >=20 > For avoiding revealing anything, I think a case can be argued for both. = I've > reverted back to the default though. >=20 > I also renamed the GUC sha_256 to match terminology we use. + "SET password_encryption=3D'scram-sha-256'; + SET scram_sha_256_iterations=3D100000; Maybe use a lower value to keep the test cheap? + time of encryption. In order to make use of a changed value, new + password must be set. "A new password must be set". Superuser-only GUCs should be documented as such, or do you intend to make it user-settable like I suggested upthread :) ? -- Michael --zuSA3iHrWub3mXD+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmOdNyIACgkQnvQgOdby QH0vpw/9EjbqKLHK9jzLBEP8Hb2R5sn+nRBGWnMywxfTgTFwWMl8sYNqaWeKq+br WSg8OPJTEmHwaKO9RREdBSHjEk61havnrsZo3dksX+DxEk9lNBPev5UbscXp3aWa 25NQp+vac+RC3bRNGxJI8V6AKz8NKohT6DF0dIprb7AaLRrCj0tHX0DQW9Z1p/N5 hlJ608Fp5rY+sgmTVzkz4eeRl7ygFanfnHmAQssm4BDO+SpF/5K1ToLtM75DVRBp 864h9gXe6fPWjnl47eP2jUud5gjIS3zzweY2rXx5Yqa/svRkHUE60FNe6PNeeXgz nEVn/7OHB4qjaKHl27L9dzmgcQvU+5D+nk/7/phQTKoV2WMNvH0k6VQc6I21g0T7 zVvcGK+Er8wDiVLMKkX7RDzH/Bqp7oVwz03+yWCKNbfZbFsXcCHZG+9rrBhOkMZC UZ1/Qa/Oe140RCMwOKdDsDb5KIafPG43dUDW2hT4O21PlJs3rWlTmSA+ugzUsexb VbddWzoOvtP1H+UZeNA7I0Rc0diSPnUoSMBK2mIM35CVQ8uyh4XT6ykUXFHgCGzs 4nPLEb9TZW31DsxkGmTSQw7dlOCW9Oif1UB4KDD8I/k8GulevCL+OYzmEWeLdnbO aeKgUjezvg3G3rVjq7x6f18jk9srJ/H+mmuINGsupZWHvKBlVtg= =Sb3g -----END PGP SIGNATURE----- --zuSA3iHrWub3mXD+--