diff options
| author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2017-04-21 22:51:57 +0300 |
|---|---|---|
| committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2017-04-21 22:51:57 +0300 |
| commit | 68e61ee72eb6914f493f08be98363c2f980ee242 (patch) | |
| tree | 258e46c2790aa1341a2676aa1d424b6a78005092 /doc/src | |
| parent | c29a752c683d9b08ee1376709b825532e94c2709 (diff) | |
Change the on-disk format of SCRAM verifiers to conform to RFC 5803.
It doesn't make any immediate difference to PostgreSQL, but might as well
follow the standard, since one exists. (I looked at RFC 5803 earlier, but
didn't fully understand it back then.)
The new format uses Base64 instead of hex to encode StoredKey and
ServerKey, which makes the verifiers slightly smaller. Using the same
encoding for the salt and the keys also means that you only need one
encoder/decoder instead of two. Although we have code in the backend to
do both, we are talking about teaching libpq how to create SCRAM verifiers
for PQencodePassword(), and libpq doesn't currently have any code for hex
encoding.
Bump catversion, because this renders any existing SCRAM verifiers in
pg_authid invalid.
Discussion: https://www.postgresql.org/message-id/351ba574-85ea-d9b8-9689-8c928dd0955d@iki.fi
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/catalogs.sgml | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index ed74704b2ad..787fcbd51ac 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1376,14 +1376,22 @@ 32-character hexadecimal MD5 hash. The MD5 hash will be of the user's password concatenated to their user name. For example, if user <literal>joe</> has password <literal>xyzzy</>, <productname>PostgreSQL</> - will store the md5 hash of <literal>xyzzyjoe</>. If the password is - encrypted with SCRAM-SHA-256, it consists of 5 fields separated by colons. - The first field is the constant <literal>scram-sha-256</literal>, to - identify the password as a SCRAM-SHA-256 verifier. The second field is a - salt, Base64-encoded, and the third field is the number of iterations used - to generate the password. The fourth field and fifth field are the stored - key and server key, respectively, in hexadecimal format. A password that - does not follow either of those formats is assumed to be unencrypted. + will store the md5 hash of <literal>xyzzyjoe</>. + </para> + + <para> + If the password is encrypted with SCRAM-SHA-256, it has the format: +<synopsis> +SCRAM-SHA-256$<replaceable><iteration count></>:<replaceable><salt></>$<replaceable><StoredKey></>:<replaceable><ServerKey></> +</synopsis> + where <replaceable>salt</>, <replaceable>StoredKey</> and + <replaceable>ServerKey</> are in Base64 encoded format. This format is + the same as that specified by RFC 5803. + </para> + + <para> + A password that does not follow either of those formats is assumed to be + unencrypted. </para> </sect1> |
