Re: scram and \password

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: scram and \password
Date: 2017-03-17 12:32:31
Message-ID: e2c82898-8e8a-d1c6-d748-902c6dd366b9@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/17/2017 02:01 PM, Robert Haas wrote:
> On Thu, Mar 16, 2017 at 11:38 PM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
>> At least this has the merit of making \password simpler from psql
>> without a kind of --method option: if the backend is 9.6 or older,
>> just generate a MD5-hash, and SCRAM-hash for newer versions.
>> PQencryptPassword still needs to be extended so as it accepts a hash
>> method though.
>
> What if the user doesn't want to switch to SCRAM because they also use
> some connector that hasn't been updated to support it?
>
> I bet there will be a lot of people in that situation.

You could use the less secure server-side ALTER USER to set the password
in that case. Or use an older client. But I agree, it's a bit weird if
we don't allow the user to generate an MD5 hash, if he insists. I think
we still need a 'method' option to \password.

It would make sense to have \password obey password_encryption GUC. Then
\password and ALTER USER would do the same thing, which would be less
surprising. Although it's also a bit weird for a GUC to affect
client-side behavior, so perhaps better to just document that \password
will create a SCRAM verifier, unless you explicitly tell it to create an
MD5 hash, and add a 'method' parameter to it.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2017-03-17 12:38:02 Re: [BUGS] Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together.
Previous Message Amit Kapila 2017-03-17 12:30:52 Re: WAL Consistency checking for hash indexes