pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Lelarge <guillaume.lelarge@dalibo.com>
To: Greg Sabino Mullane <htamfids@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: PATCH: warn about, and deprecate, clear text passwords
Date: Mon, 24 Feb 2025 20:41:29 +0100
Message-ID: <0eda7bf1-bd05-4eb3-a50d-c138c4a9620f@dalibo.com> (raw)
In-Reply-To: <CAKAnmmLnqZD99EeFAYComu7azPDnsQVuWRBR8X9KWJ1c8TKe5g@mail.gmail.com>
References: <CAKAnmmJcXyLeBUJfqCx+-gRmkooDPnH7OmM4o=2HJRXzbMkP_g@mail.gmail.com>
	<b0c40271-b33d-48c3-9196-20233fabd7e3@dalibo.com>
	<99ba5653-b234-48b4-9bc5-4d2fad13eac4@dalibo.com>
	<CAKAnmmLnqZD99EeFAYComu7azPDnsQVuWRBR8X9KWJ1c8TKe5g@mail.gmail.com>

On 24/02/2025 14:55, Greg Sabino Mullane wrote:
> Guillaume Lelarge <guillaume.lelarge@dalibo.com 
> <mailto:guillaume.lelarge@dalibo.com>> 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





view thread (33+ messages)  latest in thread

Message-ID: <0eda7bf1-bd05-4eb3-a50d-c138c4a9620f@dalibo.com>
Permalink:  ../0eda7bf1-bd05-4eb3-a50d-c138c4a9620f@dalibo.com/
Also on:    postgresql.org/message-id/0eda7bf1-bd05-4eb3-a50d-c138c4a9620f@dalibo.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: guillaume.lelarge@dalibo.com, htamfids@gmail.com
  Subject: Re: PATCH: warn about, and deprecate, clear text passwords
  In-Reply-To: <0eda7bf1-bd05-4eb3-a50d-c138c4a9620f@dalibo.com>
  References: <CAKAnmmJcXyLeBUJfqCx+-gRmkooDPnH7OmM4o=2HJRXzbMkP_g@mail.gmail.com> <b0c40271-b33d-48c3-9196-20233fabd7e3@dalibo.com> <99ba5653-b234-48b4-9bc5-4d2fad13eac4@dalibo.com> <CAKAnmmLnqZD99EeFAYComu7azPDnsQVuWRBR8X9KWJ1c8TKe5g@mail.gmail.com> <0eda7bf1-bd05-4eb3-a50d-c138c4a9620f@dalibo.com>

* 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