Add modern SHA-2 based password hashes to pgcrypto.
authorÁlvaro Herrera <[email protected]>
Sat, 5 Apr 2025 17:16:58 +0000 (19:16 +0200)
committerÁlvaro Herrera <[email protected]>
Sat, 5 Apr 2025 17:17:13 +0000 (19:17 +0200)
commit749a9e20c9790006f3af47f7a8faf4ad8dc358d9
treef06c2be00fe91ac6edead896d7981b8b4c76b11e
parente33f2335a9d9754ccf3bf7181085cfa581ee03c3
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 <[email protected]>
Reviewed-by: Japin Li <[email protected]>
Discussion: https://postgr.es/m/c763235a2757e2f5f9e3e27268b9028349cef659[email protected]
contrib/pgcrypto/Makefile
contrib/pgcrypto/crypt-gensalt.c
contrib/pgcrypto/crypt-sha.c [new file with mode: 0644]
contrib/pgcrypto/expected/crypt-shacrypt.out [new file with mode: 0644]
contrib/pgcrypto/meson.build
contrib/pgcrypto/px-crypt.c
contrib/pgcrypto/px-crypt.h
contrib/pgcrypto/sql/crypt-shacrypt.sql [new file with mode: 0644]
doc/src/sgml/pgcrypto.sgml