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 1tbO4f-00ALKS-FM for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jan 2025 18:06:34 +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 1tbO4e-00GGUV-DL for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jan 2025 18:06:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tbO4d-00GGUN-K0 for pgsql-hackers@lists.postgresql.org; Fri, 24 Jan 2025 18:06:32 +0000 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tbO4Z-001JIw-1m for pgsql-hackers@postgresql.org; Fri, 24 Jan 2025 18:06:31 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id B25AA11400BF; Fri, 24 Jan 2025 13:06:25 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Fri, 24 Jan 2025 13:06:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1737741985; x=1737828385; bh=b lmPGFUsrhE2KRoZxofW5oV/7HsVAQDvomQLOxgsVxo=; b=xjK1LTLMcqGgfi1xN 2ZLVJCkYHsWMPwTz3fw2LJtoLkf/03PSH6Lx0wAIYzaPLPxLJMMLuhxYB7sP8snG Z0eZL7tjtvHZpakO1bhA8ReYO8V8StgXOMyZzTRB9VBigCA9yZtTMsyW4XaU0j7f 2eYvGoG3KD2AjY0gffKobPaT9sRc8NaYPbM0sOnDs7S9BocUnAVvO5MfdE7wq38f Z3+8+neLDP2CoapQ/GpTgqqikiumJa3+H31KovT0I3VKVpF43MUBE27VS0vT2yIr h4Vl05R5znvm/B/28lQ0AKQ4NZmYD5oSEUbn2f+SQaQyXuljqURA15WFda6KX1AW 1KW8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedghedulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdej necuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheff hfejjefhgfeiueeukeejkeffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrh hprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspg hrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhgrphhinhhl iheshhhothhmrghilhdrtghomhdprhgtphhtthhopehmrghilhhinhhgshesohhophhsfi grrhgvrdguvgdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgv shhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Jan 2025 13:06:24 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1737741981; bh=g3h/eNU4MQdYxWkC7jYzw5raGxdbIQAwuxnLPMQmoEY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=WHBi/JNQ8HArtfwyi6oWz8uYT0clrcDJEcS3PVxLO6brgxYpTyLWezPR5G1dego5v bOtiFoQcZYGxmmwxGlwOhs3Yc4aPA3/5/W0AybmCJtgDoKHCWM9A9kxsORd2eWo6Vr nfGHnE4rnUt6i8tLkgg/dP3uxmny2nqMBGYO68d7ZqRHDHBeqRfsUQq1iP70G3q1W1 seN329DwJ4Qovff8ZJBtMRZ9t7vNCPNoVkU2pG3kDPVmfH+0LL6+AWbImosoU9hp3H cbSJPw+G8ISPUR3xq2mvjp9yut6KQJN77FXinq9N1bChXR7Csgo4zNM6WAAhaVgI9m f7334lT54Tncw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 83DDA8A; Fri, 24 Jan 2025 19:06:21 +0100 (CET) Date: Fri, 24 Jan 2025 19:06:21 +0100 From: Alvaro Herrera To: Bernd Helmle Cc: Japin Li , PostgreSQL Development Subject: Re: Modern SHA2- based password hashes for pgcrypto Message-ID: <202501241806.awm2djrgyehi@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1f3f264bd40b6eba7380e7da19013417029a93aa.camel@oopsware.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Jan-24, Bernd Helmle wrote: > So we behave exactly the same way as px_crypt_md5(): It stops after the > first '$' after the magic byte preamble. For shacrypt, this could be > the next '$' after the closing one of the non-mandatory 'rounds' > option, but with your example this doesn't happen since it gets never > parsed. The salt length will be set to 0. IMO silently using no salt or 0 iterations because the input is somewhat broken is bad security and should be rejected. If we did so in the past without noticing, that's bad already, but we should not replicate that behavior any further. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Doing what he did amounts to sticking his fingers under the hood of the implementation; if he gets his fingers burnt, it's his problem." (Tom Lane)