pgsql: Warn on password auth with MD5-encrypted passwords

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Warn on password auth with MD5-encrypted passwords
Date: 2026-07-01 11:58:32
Message-ID: E1wetaK-000uaJ-2R@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Warn on password auth with MD5-encrypted passwords

Commit bc60ee860 added a connection warning after successful MD5
authentication, but only for the md5 authentication method. A role with
an MD5-encrypted password can also authenticate via the password method,
which left that path without the same deprecation warning.

Emit the MD5 deprecation connection warning after successful
password authentication as well, when the stored password is
MD5-encrypted.

Backpatch to v19, where the MD5 connection warning was introduced.

Author: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Japin Li <japinli(at)hotmail(dot)com>
Discussion: https://postgr.es/m/CAHGQGwGkWfn5rtHzvdRbVk+PCefQU3gun3hc7QnaMXHFa5Bu3w@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f6fdc2a4a737b62323b786aea59ab7a38cd7f835

Modified Files
--------------
doc/src/sgml/config.sgml | 3 ++-
src/backend/libpq/auth.c | 33 +++++++++++++++++++++++++++++++
src/backend/libpq/crypt.c | 22 ---------------------
src/test/authentication/t/001_password.pl | 10 ++++++++++
4 files changed, 45 insertions(+), 23 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-07-01 11:58:46 pgsql: Warn on password auth with MD5-encrypted passwords
Previous Message Peter Eisentraut 2026-07-01 11:55:07 pgsql: Fix mismatched deallocation functions