pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Robert Haas <robertmhaas@gmail.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Joe Conway <mail@joeconway.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: scram and \password
Date: Fri, 17 Mar 2017 14:32:31 +0200
Message-ID: <e2c82898-8e8a-d1c6-d748-902c6dd366b9@iki.fi> (raw)
In-Reply-To: <CA+TgmoYreNVHDLYxH58Yew8SpYXppiJswJo=FEK0kBiNf06DHQ@mail.gmail.com>
References: <CAMkU=1wfBgFPbfAMYZQE78p=VhZX7nN86aWkp0QcCp=+KxZ=bg@mail.gmail.com>
	<CAB7nPqSELwmfwgOt8U_rK15sHWuGeLhsWYihRtq9ADC3MZ=HTg@mail.gmail.com>
	<CA+TgmoY3VmPTn8gaKhx2fXXiMX_U2Ozf3qMXyVa+zsuMMox1HA@mail.gmail.com>
	<CAB7nPqTZNZkbezTZ3WrTBU42cAuAGjyukJAs=iw=KN4GZGoXxA@mail.gmail.com>
	<CA+TgmoYHvtOYex0N0DTm3hAvgZezZZpH789a13MzHDh_VgG9Ew@mail.gmail.com>
	<29551.1489459676@sss.pgh.pa.us>
	<e4c3807b-fc53-5657-5372-b156e673a9d5@iki.fi>
	<39228d95-2560-19e4-d907-b1fd5a75fd23@joeconway.com>
	<6425.1489506016@sss.pgh.pa.us>
	<CAMkU=1wDS_RE_DXUDPF3s4EE8ENp3-svmcvmKfmSVa6QSNyV7g@mail.gmail.com>
	<16350.1489526094@sss.pgh.pa.us>
	<a8b0d5cb-35d4-d686-3fae-f743659ae346@iki.fi>
	<CAB7nPqSjSmYK7H3S8A98giR6Jb=jKKTOMMruK1Kxw5Lfxc+Baw@mail.gmail.com>
	<CA+TgmoYreNVHDLYxH58Yew8SpYXppiJswJo=FEK0kBiNf06DHQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 03/17/2017 02:01 PM, Robert Haas wrote:
> On Thu, Mar 16, 2017 at 11:38 PM, Michael Paquier
> <michael.paquier@gmail.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



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (81+ messages)  latest in thread

Message-ID: <e2c82898-8e8a-d1c6-d748-902c6dd366b9@iki.fi>
Permalink:  ../e2c82898-8e8a-d1c6-d748-902c6dd366b9@iki.fi/
Also on:    postgresql.org/message-id/e2c82898-8e8a-d1c6-d748-902c6dd366b9@iki.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: hlinnaka@iki.fi, robertmhaas@gmail.com, michael.paquier@gmail.com, tgl@sss.pgh.pa.us, jeff.janes@gmail.com, mail@joeconway.com
  Subject: Re: scram and \password
  In-Reply-To: <e2c82898-8e8a-d1c6-d748-902c6dd366b9@iki.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox