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 1hIjxZ-0006tW-2k for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Apr 2019 01:10:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIjxX-0006vX-F8 for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Apr 2019 01:10:55 +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 1hIjxX-0006vM-7Y for pgsql-bugs@lists.postgresql.org; Tue, 23 Apr 2019 01:10:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIjxV-0004El-4o for pgsql-bugs@lists.postgresql.org; Tue, 23 Apr 2019 01:10:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3N1AnrI010699; Mon, 22 Apr 2019 21:10:49 -0400 From: Tom Lane To: Michael Paquier cc: "Jonathan S. Katz" , pgsql-bugs@lists.postgresql.org, Stephen Frost Subject: Re: Possible to store invalid SCRAM-SHA-256 Passwords In-reply-to: <20190423010142.GE2712@paquier.xyz> 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> <5a93333c-dde6-ee52-f870-4dccfc50eb6f@postgresql.org> <30284.1555972921@sss.pgh.pa.us> <15140775-08c3-45bd-6dab-fdcd290d1bf0@postgresql.org> <20190423010142.GE2712@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Tue, 23 Apr 2019 10:01:42 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10697.1555981849.1@sss.pgh.pa.us> Date: Mon, 22 Apr 2019 21:10:49 -0400 Message-ID: <10698.1555981849@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > There is no point for the second strlen() check, as strspn does the > same work. Um, no --- the strspn call will count the number of bytes of hex data, but without also checking strlen, you don't know that there's not non-hex trailing junk. regards, tom lane