Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cor3f-0001eZ-1q for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Mar 2017 12:32:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cor3e-0001G2-Kn for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Mar 2017 12:32:38 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cor3d-0001Ft-Vm for pgsql-hackers@postgresql.org; Fri, 17 Mar 2017 12:32:38 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cor3a-0007UJ-BH for pgsql-hackers@postgresql.org; Fri, 17 Mar 2017 12:32:37 +0000 Received: by mail-lf0-x243.google.com with SMTP id g70so5416536lfh.3 for ; Fri, 17 Mar 2017 05:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=MAtdZesErA/oXWStdMuopDmM1ifVb41jZ1sDm9FEjDs=; b=vNhMwq/cGeMUqeN2+6FaV7+IrqPQQ6K0TnnzOXj70UAz0ChBjKdkfvhufoySfEySJL ce1cnY0fMY2IjxbE74buaiNKZgvBH4F8DYvmzvCGm57AAdvCvezypAZfmjuejgB2/NTB 4FdI323FpXw8ZHIOs2D5nBgMGcFkltdYAEcDAwE/TLSIu9uGuYPlYiaMeUXRx/dGymyS w0aSzUuTJdUkkqQ74gOr27Q6KsJsh2Log6yBGap1aLOam3DdYUzSQvndZZ4i8M9sDEZ7 MLNbT0KhPz8dY++jr8Bgvhg96Xc7+SdzKBs37xFQArFV4xjr6d7To9ZCsTU0GLkbpaNC I8Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=MAtdZesErA/oXWStdMuopDmM1ifVb41jZ1sDm9FEjDs=; b=M6362Tdxu5kGJOGBbiSUeU8yq1qo8EtGUkHzi+NzwP4TZ22ozIYpiIdy/2QM1McE07 qiu41XXl/mJfYQhB9j3FKmfrodEh2MabakE2Ia9qWLHgya3+VW0ZYU+GmMdkLIRTQCng OXXvi7diSOf/AahBGIa2VqDRhk2eGXR2W6uy9TxYiM0i76M9txd9+oQBQIS4XIT6LVAj 5D7P5XT9VCU4edrcREB9w9J6dk2K2mQRzDE0mSGznbyiEBlt068l+Z7//iTKxJNcl1Ow 6v9sZOk2iUMmGcu9HZjMlBN7rBncqQwIXkb+nOh7y0JsMuM2WBReL4PijqtH20/DAro0 Po2g== X-Gm-Message-State: AFeK/H0YLAHDYy3STcrI3f6l1jF1HP7bFu1gms1FgCccAzC5hu4kC/bNpaqY+utnfqOFJw== X-Received: by 10.46.71.69 with SMTP id u66mr4436951lja.99.1489753953427; Fri, 17 Mar 2017 05:32:33 -0700 (PDT) Received: from [192.168.1.99] (dsl-hkibrasgw1-50df7f-241.dhcp.inet.fi. [80.223.127.241]) by smtp.gmail.com with ESMTPSA id b16sm1447536lfe.30.2017.03.17.05.32.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 05:32:32 -0700 (PDT) Subject: Re: scram and \password To: Robert Haas , Michael Paquier References: <29551.1489459676@sss.pgh.pa.us> <39228d95-2560-19e4-d907-b1fd5a75fd23@joeconway.com> <6425.1489506016@sss.pgh.pa.us> <16350.1489526094@sss.pgh.pa.us> Cc: Tom Lane , Jeff Janes , Joe Conway , pgsql-hackers From: Heikki Linnakangas Message-ID: Date: Fri, 17 Mar 2017 14:32:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.4 (--) 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/17/2017 02:01 PM, Robert Haas wrote: > On Thu, Mar 16, 2017 at 11:38 PM, Michael Paquier > 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