Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1alJ31-0004aT-1S for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Mar 2016 16:32:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1alJ30-0003Im-KS for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Mar 2016 16:32:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1alJ1e-0001eW-H5 for pgsql-hackers@postgresql.org; Wed, 30 Mar 2016 16:31:22 +0000 Received: from hermes.doblenet.net ([213.27.130.15]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1alJ1X-0003Ek-DW for pgsql-hackers@postgresql.org; Wed, 30 Mar 2016 16:31:21 +0000 Received: from vortex.hq.g4ii.com (hq.g4ii.com [88.26.239.182]) by hermes.doblenet.net (Postfix) with ESMTPSA id 3qZtSJ0M4bz36; Wed, 30 Mar 2016 18:31:12 +0200 (CEST) Subject: Re: Password identifiers, protocol aging and SCRAM protocol To: Robert Haas , Michael Paquier References: <56E6D98F.1070701@pgmasters.net> <56EAF483.3030307@pgmasters.net> <20160318181252.GA3127@tamriel.snowman.net> <56FAB0D3.6070003@uni-muenster.de> Cc: Julian Markwort , Magnus Hagander , Stephen Frost , David Steele , PostgreSQL mailing lists , Valery Popov From: =?UTF-8?B?Sm9zw6kgTHVpcyBUYWxsw7Nu?= Message-ID: <56FBFF4F.9080505@adv-solutions.net> Date: Wed, 30 Mar 2016 18:31:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 03/30/2016 06:14 PM, Robert Haas wrote: > So basically the use of the ENCRYPTED keyword means "if it does > already seem to be the sort of MD5 blob we're expecting, turn it into > that". If it does NOT already seem to be... I guess? > And we just rely on the format to distinguish between an MD5 verifier > and an unencrypted password. Personally, I think a good start here, > and I think you may have something like this in the patch already, > would be to split rolpassword into two columns, say rolencryption and > rolpassword. This inches closer to Michael's suggestion to have multiple verifiers per pg_authid user ... > rolencryption says how the password verifier is encrypted and > rolpassword contains the verifier itself. Initially, rolencryption > will be 'plain' or 'md5', but later we can add 'scram' as another > choice, or maybe it'll be more specific like 'scram-hmac-doodad'. May I suggest using "{" ["."] "}" just like Dovecot does? e.g. "{md5.hex}e748797a605a1c95f3d6b5f140b2d528" where no "{ ... }" prefix means just fallback to the old method of trying to guess what the blob contains? This would invalidate PLAIN passwords beginning with "{", though, so some measures would be needed. > And then maybe introduce syntax like this: alter user rhaas set > password 'raw-unencrypted-passwordt' using 'verifier-method'; alter > user rhaas set password verifier 'verifier-goes-here' using > 'verifier-method'; That might require making verifier a key word, > which would be good to avoid. Perhaps we could use "password > validator" instead? I'd like USING best ... though by prepending the schema for ENCRYPTED, the required information is already conveyed within the verifier, so no need to specify it again :) Just my .02€ / J.L. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers