Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u111U-00CPPZ-GK for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Apr 2025 10:45:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u111R-00C0MA-F0 for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Apr 2025 10:45:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u111R-00C0M1-36 for pgsql-hackers@lists.postgresql.org; Sat, 05 Apr 2025 10:45:09 +0000 Received: from dd48506.kasserver.com ([85.13.164.188]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u111O-0035lx-18 for pgsql-hackers@postgresql.org; Sat, 05 Apr 2025 10:45:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oopsware.de; s=kas202503021101; t=1743849903; bh=zD+q89Ly6p+1ztIjgP0onudgvOaCoIhcqM60Eoy4P2M=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=htH8ScL6jySZtf7ICCX2tg/JfUrWjqYHvjhCdWdi21YjeyKZZ3WCgSSOl4tdutQvU 5cQKa0vZmAT+RRrH9K/4vFfvwlbJPFvqsnJBbphgOqu0hTOr/LMV3uv1aFgDu6RCOg rDeiRV7N2KEl7TTgvaQQzpAVQKYcycl0VXB6yu3nOXZiicjcMBYM3aMxZXnb3G6opa pxR+NZbTbihvySfzg1iHmnwIEDpg0W+qPB0mGCLZ9jyMalZ2YZimfmufQHy2tKbfYa mNJPxofyMfyap2vrIqB9I3VZT3DmeZT+iQ57f29x8jWJL6iXbHr481C1dMLzTE+7nJ 9YlICHE92hbIg== Received: from siamun.bluecherstrasse.oopsware.lan (i5C75098A.versanet.de [92.117.9.138]) by dd48506.kasserver.com (Postfix) with ESMTPSA id 1AADB86658A3; Sat, 5 Apr 2025 12:45:03 +0200 (CEST) Message-ID: <7efa840e08ee30cb2fc964c56a1954bece2dd1b4.camel@oopsware.de> Subject: Re: Modern SHA2- based password hashes for pgcrypto From: Bernd Helmle To: Alvaro Herrera Cc: Japin Li , PostgreSQL Development Date: Sat, 05 Apr 2025 12:45:02 +0200 In-Reply-To: <202504031839.ly54uxe6hqed@alvherre.pgsql> References: <202504031839.ly54uxe6hqed@alvherre.pgsql> Autocrypt: addr=mailings@oopsware.de; prefer-encrypt=mutual; keydata=mQGiBEIM4dYRBACEnxQZ/CfR1xbCJzGOIjvh3fZpLALMm+tt237QlZm9nlLaEwCn317sT 1khPAJwhyBHSHbNFbH+LOL6ezYrg4V2Q9KHyYJDStJtC8c+D7vHVB5Jfslynx89DnCH6jb3H0j+U0 iNYmRmT18PWTZhD5RuXT+Toyz/0hH4YnJzha4VUwCggikXRuhIQ0KIzrps7/PsvasTPjUD/1aoEHR wVyk2C2hXh6GWJYq+1l+sB2d0TOnFJf2xy3Xo03Hi+BEJJdYGqJKqzd0KfsFyJYhO2GIGScSEj1hs TqAiY8OZeRqRGHe69OQEguUSVXp/jPaqU8fel8dbDDMnXkgULq8oO4T9e4GJSFqIvrlx0sJqSMFdi ihV+xCzDS40BACBrTq9tyXmyxJWzQ1/0Hx9S4sU+yeR8ztZH9xgWi1wksfHpEgZBdAkQynlI80/bC tgxfVu+LKgxeqGfMSnT9t8agpr1IGcmSbDntbn/K+3EmCze0jq8EQrZHJWiwCqraM8mnmILSEl5zn aoVoBIF062b60zZicuNeYaVgEKSHfirQgQmVybmQgSGVsbWxlIDxiZXJuZEBvb3Bzd2FyZS5kZT6I XgQTEQIAHgUCQhyP2gIbAwYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRBRdc2OhdlKzMm4AJ9mW1np2 RXi66WzEvcIanaJkDT+xgCfZmXG/Sziz5FchI3OjXfXDZfwnNm0J0Jlcm5kIEhlbG1sZSA8YmVybm QuaGVsbWxlQG9vcHN3YXJlLmRlPoheBBMRAgAeBQJCDOHWAhsDBgsJCAcDAgMVAgMDFgIBAh4BAhe AAAoJEFF1zY6F2UrMWZgAn3MVwDBzRS5dZu1yjx7WU3E3JSheAJ41CUYMIkX/oYfWssUVYnOuedgn 8LQlQmVybmQgSGVsbWxlIDxiaEBzY2huYWVwcGNoZW5qYWdkLmRlPoheBBMRAgAeBQJCHI+pAhsDB gsJCAcDAgMVAgMDFgIBAh4BAheAAAoJEFF1zY6F2UrMYMUAn0rk8fEEY2tHGSUD7PNbk+Fwkd7MAJ 4wMfOerrvsKTrB9xmFnZ2ZUy67w7QjQmVybmQgSGVsbWxlIDxtYWlsaW5nc0Bvb3Bzd2FyZS5kZT6 IXgQTEQIAHgUCQhyPxgIbAwYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRBRdc2OhdlKzOhrAJ4w+A3H cjTJb54lUDpyyQu6Y5dlVQCeJCFKygOVbpn4HSp4Z+R6+s4Rul60J0Jlcm5kIEhlbG1sZSA8YmVyb mQuaGVsbWxlQGN5YmVydGVjLmF0Poh4BBMRAgA4FiEEcLVWcrwQIdBqHtvMUXXNjoXZSswFAmDe1D kCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQUXXNjoXZSszs9QCfbbpKT0/Mh4PhfS6rRbm NNQC1zS8An2x1PLHPS6649DRkiYOMWTXzAlSE Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 X-Spamd-Bar: --- List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Am Donnerstag, dem 03.04.2025 um 20:39 +0200 schrieb Alvaro Herrera: >=20 > > Maybe, in case of empty salts, we should issue a WARNING instead of > > erroring out and put additional documentation on how to use it > > right. >=20 > I don't know, that doesn't seem ideal to me, because it's very easy > to > run stuff and never see the warnings.=C2=A0 If we find that people are > desperate to use empty salts, we can relax that later (turn the error > to > a warning), but I'd rather not have it in the first cut. >=20 That's a good idea, Let's go with that. Thanks again for working on this. > > Hmm, i didn't understand that passlib does decode them first, i > > thought > > they use it encoded... at least, in our current form we're pretty > > much > > compatible with Drepper, passlib and OpenSSL, as far as i tested: >=20 > I am ready to believe that I misinterpreted what I read. >=20 I hope i didn't parse it wrong either. But i didn't see forcing something like this according in either passlib and Drepper's code. Maybe we need have to look closer again ... [...] >=20 >=20 > I can offer a few cosmetic changes.=C2=A0 0001 is a pgindent run, and 000= 2 > is > some manual adjustments after that.=C2=A0 There are only two nontrivial > changes >=20 > 1. the calculation for rounds was using type long, which is confusing > because the range is different according to the platform.=C2=A0 Since it'= s > limited by the macro definitions to no more than 999999999, we can > make > it an int32 instead.=C2=A0 So we use strtoint() instead of strtoul() to > parse > the value, and remove the "l" suffixes from the macros that define > the > limits and default, which were bugging me a bit when used in the > gen_list struct. +1 --=20 Bernd Helmle Bl=C3=BCcherstrasse 17 41061 M=C3=B6nchengladbach Tel.: +49 172 726 99 66