pgsql: Add modern SHA-2 based password hashes to pgcrypto.

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add modern SHA-2 based password hashes to pgcrypto.
Date: 2025-04-05 17:21:25
Message-ID: E1u17Cv-002pvr-0K@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add modern SHA-2 based password hashes to pgcrypto.

This adapts the publicly available reference implementation on
https://www.akkadia.org/drepper/SHA-crypt.txt and adds the new hash
algorithms sha256crypt and sha512crypt to crypt() and gen_salt()
respectively.

Author: Bernd Helmle <mailings(at)oopsware(dot)de>
Reviewed-by: Japin Li <japinli(at)hotmail(dot)com>
Discussion: https://postgr.es/m/c763235a2757e2f5f9e3e27268b9028349cef659.camel@oopsware.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/749a9e20c9790006f3af47f7a8faf4ad8dc358d9

Modified Files
--------------
contrib/pgcrypto/Makefile | 3 +-
contrib/pgcrypto/crypt-gensalt.c | 82 ++++
contrib/pgcrypto/crypt-sha.c | 640 +++++++++++++++++++++++++++
contrib/pgcrypto/expected/crypt-shacrypt.out | 196 ++++++++
contrib/pgcrypto/meson.build | 2 +
contrib/pgcrypto/px-crypt.c | 22 +
contrib/pgcrypto/px-crypt.h | 31 ++
contrib/pgcrypto/sql/crypt-shacrypt.sql | 99 +++++
doc/src/sgml/pgcrypto.sgml | 41 +-
9 files changed, 1114 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-04-05 19:01:59 pgsql: Fix parse_cte.c's failure to examine sub-WITHs in DML statements
Previous Message Tom Lane 2025-04-05 16:14:31 pgsql: Avoid double transformation of json_array()'s subquery.