postgresql/src/include/libpq
Heikki Linnakangas e7f051b8f9 Refactor the code for verifying user's password.
Split md5_crypt_verify() into three functions:
* get_role_password() to fetch user's password from pg_authid, and check
  its expiration.
* md5_crypt_verify() to check an MD5 authentication challenge
* plain_crypt_verify() to check a plaintext password.

get_role_password() will be needed as a separate function by the upcoming
SCRAM authentication patch set. Most of the remaining functionality in
md5_crypt_verify() was different for MD5 and plaintext authentication, so
split that for readability.

While we're at it, simplify the *_crypt_verify functions by using
stack-allocated buffers to hold the temporary MD5 hashes, instead of
pallocing.

Reviewed by Michael Paquier.

Discussion: https://www.postgresql.org/message-id/3029e460-d47c-710e-507e-d8ba759d7cbb@iki.fi
2016-12-12 12:48:13 +02:00
..
auth.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
be-fsstubs.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
crypt.h Refactor the code for verifying user's password. 2016-12-12 12:48:13 +02:00
hba.h Add authentication parameters compat_realm and upn_usename for SSPI 2016-04-08 20:28:38 +02:00
ifaddr.h Move code shared between libpq and backend from backend/libpq/ to common/. 2016-09-02 13:49:59 +03:00
libpq-be.h Replace PostmasterRandom() with a stronger source, second attempt. 2016-12-05 13:42:59 +02:00
libpq-fs.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
libpq.h Remove declarations for pq_putmessage_hook and pq_flush_hook. 2016-10-31 09:14:46 -04:00
pqcomm.h Drop server support for FE/BE protocol version 1.0. 2016-10-11 12:19:18 -04:00
pqformat.h Fix several mistakes around parallel workers and client_encoding. 2016-06-30 18:35:32 -04:00
pqmq.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pqsignal.h Update copyright for 2016 2016-01-02 13:33:40 -05:00