Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tmeKd-008QpA-Eo for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Feb 2025 19:41:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tmeKc-0076ti-OU for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Feb 2025 19:41:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tmeKc-0076tZ-Cu for pgsql-hackers@lists.postgresql.org; Mon, 24 Feb 2025 19:41:34 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tmeKZ-000Wzc-1r for pgsql-hackers@lists.postgresql.org; Mon, 24 Feb 2025 19:41:33 +0000 Received: from [192.168.1.131] (35.108.220.81.rev.sfr.net [81.220.108.35]) by mail.dalibo.com (Postfix) with ESMTPSA id EC2752799B; Mon, 24 Feb 2025 20:41:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1740426090; bh=NLgiDI/VDy+jSTfKwDeXaK0Vkc1Y3oNSbOgyB/9OsZw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dOpbX3gZZijtI5UkxbD3cKewEinwa74k+Dx2X277yUL6Qtxr9+2LA/dJO0Kh86bTn X4AKqktsT2cdwcKsPeM1Z2hEsOKvo2a0eQ/rDnqT3VSZn/m5z5lAoT+QARjYa1PZue DPwZaJm2VCBAisr6XGFJ1Rtr8prmb0Cea92xzOW8= Message-ID: <0eda7bf1-bd05-4eb3-a50d-c138c4a9620f@dalibo.com> Date: Mon, 24 Feb 2025 20:41:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PATCH: warn about, and deprecate, clear text passwords To: Greg Sabino Mullane Cc: pgsql-hackers@lists.postgresql.org References: <99ba5653-b234-48b4-9bc5-4d2fad13eac4@dalibo.com> Content-Language: fr From: Guillaume Lelarge Organization: Dalibo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 24/02/2025 14:55, Greg Sabino Mullane wrote: > Guillaume Lelarge > wrote: > > I'm obviously +1 on this patch since I sent kinda the same patch two > weeks ago > > > Ha ha, my brain forgot about that one (even though I commented on it!) - > apologies for that. > No need to apologize :) > set password_encryption to 'md5'; > create user u4 password 'md5u1'; > ... > > It complains that I'm using a plain text password and a MD5- > encrypted password. Can't be both. (Probably not an issue with this > patch, but rather an issue with the commit that implemented MD5- > password warnings.) > > > This is correct - it can be both. Not only are we sending a password in > clear text, but we then encrypt it using MD5. Hence, two warnings. > > If I use a real md5 password, it only complains about MD5 encrypted > password: > > > Right. If someone sends us something that looks like an already- > encrypted password, we just store it. See get_password_type() in > backend/libpq/crypt.c. In which case, the actual password that a client > would type in would *not* be what was sent over the wire as part of the > ALTER USER / CREATE USER, so we don't complain. Sounds good to me. -- Guillaume Lelarge Consultant https://dalibo.com