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 1hIgoh-00063k-8d for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Apr 2019 21:49:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIgof-000111-7C for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Apr 2019 21:49:33 +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 1hIgoe-0000zF-Vx for pgsql-bugs@lists.postgresql.org; Mon, 22 Apr 2019 21:49:33 +0000 Received: from ook.raf.org ([139.99.156.21]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIgoc-0007iX-Nl for pgsql-bugs@lists.postgresql.org; Mon, 22 Apr 2019 21:49:32 +0000 Received: from localhost (localhost [127.0.0.1]) by ook.raf.org (Postfix) with ESMTP id 7FB0F5E326 for ; Tue, 23 Apr 2019 07:49:24 +1000 (AEST) X-Virus-Scanned: Debian amavisd-new at ook.raf.org Received: from ook.raf.org ([127.0.0.1]) by localhost (ook.raf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xsiJdxNbYs1j for ; Tue, 23 Apr 2019 07:49:24 +1000 (AEST) Received: by ook.raf.org (Postfix, from userid 1001) id 5D8BE5E349; Tue, 23 Apr 2019 07:49:24 +1000 (AEST) Date: Tue, 23 Apr 2019 07:49:24 +1000 From: raf@raf.org To: pgsql-bugs@lists.postgresql.org Subject: Re: Possible to store invalid SCRAM-SHA-256 Passwords Message-ID: <20190422214924.pytigrzlq7mkdyzq@raf.org> References: <016deb6b-1f0a-8e9f-1833-a8675b170aa9@postgresql.org> <4240a41f-a957-fd7d-7c24-31683f259b9d@postgresql.org> <20190422015051.GA3433@paquier.xyz> <3033.1555940554@sss.pgh.pa.us> <20190422135215.GG6197@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190422135215.GG6197@tamriel.snowman.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost wrote: > I agree we should also handle md5 better. I realize this needs to be > back-patched and so we have to deal with the existing catalog structure, > but this really screams out, in my mind anyway, that we shouldn't have > ever tried to just stash the password-encoding-type into the password > field and that we should have pulled it out into its own column, so that > we aren't having to guess about things as important as a password. > > Thanks! > > Stephen I don't think there's anything wrong with prefixing a password hash with an identifier for the password hashing scheme (and any parameters for that scheme). This is done all the time in many systems. It just has to be unambiguoous.