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 1hIO71-0000Q2-SP for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Apr 2019 01:51:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIO6y-0003nv-DF for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Apr 2019 01:51:12 +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 1hIO6w-0003gi-Kg for pgsql-bugs@lists.postgresql.org; Mon, 22 Apr 2019 01:51:12 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIO6n-0004Uh-P5 for pgsql-bugs@lists.postgresql.org; Mon, 22 Apr 2019 01:51:07 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 285133FA; Sun, 21 Apr 2019 21:50:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 21 Apr 2019 21:50:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=zOIey9T6gfCKctNVTUZqDyXenmS QnP467V4rc5pkR5U=; b=lqVwSbYxVHgP95SAICCft1mJCWEhFj5Atg+EbHlL9pz /oXwYixHax8qGIt9RhZdUFLuIqyICQdx18xtOyP5XZ1csUhlXe14n+p3QV82Uljk ngrU5p1ERVhsm3FKXCXH6IPZZ3/48e/nIdLHqmuchfhRQs4BNk2LPKjv5u5Ysqc1 /0+7FH9PQmQUKK5Dl9PWLh/aZJHHn2vOOkbdkkp2AJSLg7w84Zt3rEL+7vbgZTt9 tvoAm+o9yO2o02V+LoJMXy9H+85cIFGI5BIgeOkdE90Z4bo4eGlzIKUfVVyDiHVf BYbq2J+oSX0ByKAPZqg1m1dXEAh0hwu10rWxbXrEvtQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zOIey9 T6gfCKctNVTUZqDyXenmSQnP467V4rc5pkR5U=; b=fX9N4jiRO3OfWGdJ1WvXTk nGk65G4iYgOHMeRadValJ4T1BuEXrx+EJpsNCEsT42KTY3N0t6KDHo7TnuNfKt4V Njh/eWKhTQmaJiqK9saR2qD46cZT3dVPkCOywJl199LCI/SPVdA7YnAZSlaB89yy VS+uBR0y1K4NwB5W2XcyebnhHz0r8xpqNi2Uf4feGz7GiiazhNSsJ6IgFLdhDdmR A617lBSsuqqZIz3bAwmfekQ/tutFhw0XuFOsVOdqXyzwSNE0OJXs5wKWWgOkYyfk +W7duOHWsp4+CO0wui3iYIgHlxaHqaO5C5kGLDtilhmjoi+iuPc0MgiAztrbNDgQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrgeehgdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduuddurddutddvrddukedtrddukeehnecurfgrrhgr mhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluh hsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id C0137E448F; Sun, 21 Apr 2019 21:50:55 -0400 (EDT) Date: Mon, 22 Apr 2019 10:50:51 +0900 From: Michael Paquier To: "Jonathan S. Katz" Cc: pgsql-bugs@lists.postgresql.org, Stephen Frost Subject: Re: Possible to store invalid SCRAM-SHA-256 Passwords Message-ID: <20190422015051.GA3433@paquier.xyz> References: <016deb6b-1f0a-8e9f-1833-a8675b170aa9@postgresql.org> <4240a41f-a957-fd7d-7c24-31683f259b9d@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <4240a41f-a957-fd7d-7c24-31683f259b9d@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 20, 2019 at 04:12:56PM -0400, Jonathan S. Katz wrote: > I modified the "get_password_type" function to perform a SCRAM > verification to see if it is a properly hashed SCRAM password. If it is, > we treat the password as a SCRAM hashed one. Otherwise, we proceed to > the next step, which is to treat it as a plainly stored one. Since v10, we don't allow the storage of plain verifiers so if a string does not match what we think is a correct SCRAM or MD5 verifier, then it should be processed according to password_encryption when storing the verifier or processed according to the auth protocol with the HBA entry matching. Your patch looks fine to me, I would have just added a test case in password.sql (no=20 need to send a new patch I can take care of it). Any objections to back-patch that stuff to v10? -- Michael --EeQfGwPcQSOJBaQU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAly9HfsACgkQnvQgOdby QH3wCw/8CSkK7vsZUEziY2wT3s3OzVnT2k/8RZMXKikocVBKVJYIk6FB22lXLh67 K6SG7tzBRfS9u+hvE3SKqw04Uszabb5mKKablsI+7W0a70d8AYErPPyHy3AKQr2C ezYCXF9RVDAaHTxc/63HIrGHPZWSCKGZzn0EQ5FTt/IdjfR7Z6XntU6m2mXgyudn 2cOcDXTNepqrRmQ3NUstqC9jhohagabOdNnC3f1GMrpGDQb5xqEnA6ipCovlTciH vZkFtkfaajmB7LN7EO/lEeYH7EI60dZ7NDZxyJgNbn6fRLcSH4rzWt7+A/YRGKvE vcFT4EG0ZiaUpWyYUAA72ZZQjITVVK6fo+sl5zDve3A0h9lnb5DjRBZ8e6YOGYhr wOFr1DA2B5Ws5MrjCupFSLH/huWN1teS3ouNzZN3VuL7Qqb9Jdjx6eDO5N0pp5iH QpXRLJSxVwNv1HFajckpNBmpqtg6MtMV+KXldw1jcRtT1hhEx3ECtmBVIUGxHQcc vc4anTs8AxFRGtzZ771HXa9yMEjmP3eRMl5L1bJowppDcP1GhH8ElRcLIcsINdcF QT1P5W/B+O0iJyhJX1w9B7zlqjhtVfgg/lUNzlfgkxwvec0abL7ytqCpIcwzCbxn Rs8YmHRUmNWpoxmzjYd6o5AqL+Lovfs00UkQyoSHEri4xEQsWlE= =54HE -----END PGP SIGNATURE----- --EeQfGwPcQSOJBaQU--