Add modern SHA-2 based password hashes to pgcrypto.
Álvaro Herrera <alvherre@alvh.no-ip.org>
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@oopsware.de> Reviewed-by: Japin Li <japinli@hotmail.com> Discussion: https://postgr.es/m/c763235a2757e2f5f9e3e27268b9028349cef659.camel@oopsware.de
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pgcrypto/crypt-gensalt.c | modified | +82 −0 |
| contrib/pgcrypto/crypt-sha.c | added | +640 −0 |
| contrib/pgcrypto/expected/crypt-shacrypt.out | added | +196 −0 |
| contrib/pgcrypto/Makefile | modified | +2 −1 |
| contrib/pgcrypto/meson.build | modified | +2 −0 |
| contrib/pgcrypto/px-crypt.c | modified | +22 −0 |
| contrib/pgcrypto/px-crypt.h | modified | +31 −0 |
| contrib/pgcrypto/sql/crypt-shacrypt.sql | added | +99 −0 |
| doc/src/sgml/pgcrypto.sgml | modified | +40 −1 |
Documentation touched
Discussion
- Modern SHA2- based password hashes for pgcrypto 38 messages · 2024-12-31 → 2025-04-07