postgresql/src/include/common
Michael Paquier ccae190b91 Fix detection of passwords hashed with MD5 or SCRAM-SHA-256
This commit fixes a couple of issues related to the way password
verifiers hashed with MD5 or SCRAM-SHA-256 are detected, leading to
being able to store in catalogs passwords which do not follow the
supported hash formats:
- A MD5-hashed entry was checked based on if its header uses "md5" and
if the string length matches what is expected.  Unfortunately the code
never checked if the hash only used hexadecimal characters, as reported
by Tom Lane.
- A SCRAM-hashed entry was checked based on only its header, which
should be "SCRAM-SHA-256$", but it never checked for any fields
afterwards, as reported by Jonathan Katz.

Backpatch down to v10, which is where SCRAM has been introduced, and
where password verifiers in plain format have been removed.

Author: Jonathan Katz
Reviewed-by: Tom Lane, Michael Paquier
Discussion: https://postgr.es/m/016deb6b-1f0a-8e9f-1833-a8675b170aa9@postgresql.org
Backpatch-through: 10
2019-04-23 15:43:21 +09:00
..
base64.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
config_info.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
controldata_utils.h Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
fe_memutils.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
file_perm.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
file_utils.h Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
int.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
int128.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
ip.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
keywords.h Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
kwlookup.h Use perfect hashing, instead of binary search, for keyword lookup. 2019-01-09 19:47:46 -05:00
link-canary.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
md5.h Fix detection of passwords hashed with MD5 or SCRAM-SHA-256 2019-04-23 15:43:21 +09:00
pg_lzcompress.h Add support for partial TOAST decompression 2019-04-02 12:35:32 -04:00
relpath.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
restricted_token.h Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
saslprep.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
scram-common.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
sha2.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
shortest_dec.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
string.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
unicode_norm.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
unicode_norm_table.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
username.h Update copyright for 2019 2019-01-02 12:44:25 -05:00