Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dBk8K-0001vB-VK for pgsql-bugs@arkaria.postgresql.org; Fri, 19 May 2017 15:48:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dBk8K-0000PL-8w for pgsql-bugs@arkaria.postgresql.org; Fri, 19 May 2017 15:48:04 +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 1dBk7d-0007bm-Tf for pgsql-bugs@postgresql.org; Fri, 19 May 2017 15:47:22 +0000 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dBk7Z-0001Ez-48 for pgsql-bugs@postgresql.org; Fri, 19 May 2017 15:47:20 +0000 Received: by mail-lf0-x22e.google.com with SMTP id h4so3219725lfj.3 for ; Fri, 19 May 2017 08:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=1gQOuwd3FfjdhfwGYPvddpvRYNguAhBFGyoAMxGZpPc=; b=frgdeG0wTCdFQmrJXZgHcIyyMeJPUJx19oEfRovlNjl+IlcQFD693vbsi6KLoabDby H+R9mP/QD6JPn58dLLE+5Q+MZ47FwiIeXpMs9pxsR5Dz1qmDJnZxZN0P0Ohg0npEbiCJ GYz5trD7HIZ7Ugjv3ZwLfAqIXzbQj0QJqYimCJNM2XmSAovcfBaj4Qv1ZEJBZ7vWnswi SqyXWToHyxKr93zLJMc8N5sPJDyIaPtOH7uAxP+vyftWB61RtD1SHacB1Ranlq5KpwPO 3ywb3CqKIQox/lAB+wQ4Y50RZlz3NSGeyUSmZN2eT9zhvavjoyJ/55yPUdioRfX6IGpm mMmw== 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:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=1gQOuwd3FfjdhfwGYPvddpvRYNguAhBFGyoAMxGZpPc=; b=qjJ72RzKtBmrLHPiXQZg68ndnjt3UNfRT70x/pUyiZn8ZxIaKIX9vPdoE4U3w0VvRh xkIm2tAm0h8US5FQEMVkg53hZ+C6MOu0Fehnot2uRNgfPHlGQvSS2ydvpLE3zJBbgDm2 JwVVhfVQwF5XzKSbsxRnQHZ6rYo24GB+zC8dQDrYRvWTy5AtX3jRTCY+q0yCB5DYzjE3 E6YqZrRTpZHMf8pIGzgbWzAdHmemPzxYuX89pcWc2wLkU40SuuzIDaJlrn533KIF90ac YMyzJFEw6gl/eYVgCByb37iKLLE0QuHuIYLvgDgvnfwxcY1Maae7z69aGCQAojWU5ZT5 akPg== X-Gm-Message-State: AODbwcBGQEv3a9n5wD6gEMzpydyNRm4jdzoJDYUpoEFW8ZJB2wQVLasd lp1lUSj8cODU2PhP X-Received: by 10.25.202.27 with SMTP id a27mr2385522lfg.70.1495208835067; Fri, 19 May 2017 08:47:15 -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 b71sm991836lfg.32.2017.05.19.08.47.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 08:47:14 -0700 (PDT) Subject: Re: BUG #14661: authentication behavior(SCRAM-MD5) To: asotolongo@gmail.com, pgsql-bugs@postgresql.org References: <20170519150511.29944.47622@wrigleys.postgresql.org> From: Heikki Linnakangas Message-ID: Date: Fri, 19 May 2017 18:47:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170519150511.29944.47622@wrigleys.postgresql.org> 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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 05/19/2017 06:05 PM, asotolongo@gmail.com wrote: > i think that is correct, but when i have the next configuracion: > pg_hba.conf > host all usuario 0.0.0.0/0 md5 > host all postgres 0.0.0.0/0 md5 > > and my user with SCRAM encryption > postgres=# select usename,passwd from pg_shadow ; > usename | > passwd > ----------+------------------------------------------------------------------------------------------------------------------------------- > usuario | > SCRAM-SHA-256$4096:Fhqo2W7V4FlVQk7+$fkQJ02YBGMhePbhVnKOcHjON/VPUTDzT/pZboiwHofY=:XliKl0leu/kpN4ZGmNPnHKKWj76f7qN8lIjrY8jOVcA= > postgres | > SCRAM-SHA-256$4096:5DcjppjZNyrGb0Jo$iomUsf0Mo0RSSjkwzhwHwRphhVG5EKLRRMVp/eiENuI=:XFIOQcd1nA1IKclPrVSwFym9N5dLuYB43CfI3Lf5zGA= > (2 filas) > > > and when try to login, login successfully > is correct this behavior? Yeah, "md5" in pg_hba.conf really means "md5 or scram-sha-256, depending on what kind of password hash the user has". The documentation at https://www.postgresql.org/docs/devel/static/auth-methods.html#auth-password tries to explain it: > scram-sha-256 performs SCRAM-SHA-256 authentication, as described in > RFC5802. It is a challenge-response scheme, that prevents password > sniffing on untrusted connections. It is more secure than the md5 > method, but might not be supported by older clients. > > md5 allows falling back to a less secure challenge-response mechanism > for those users with an MD5 hashed password. The fallback mechanism > also prevents password sniffing, but provides no protection if an > attacker manages to steal the password hash from the server, and it > cannot be used with the db_user_namespace feature. For all other > users, md5 works the same as scram-sha-256. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs