Skip to content

Commit a338a0d

Browse files
committed
Partial port of 0007 patch (sgml only)
1 parent b1362f8 commit a338a0d

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,13 +1310,18 @@
13101310
<entry><type>text</type></entry>
13111311
<entry>
13121312
Password (possibly encrypted); null if none. If the password
1313-
is encrypted, this column will begin with the string <literal>md5</>
1314-
followed by a 32-character hexadecimal MD5 hash. The MD5 hash
1315-
will be of the user's password concatenated to their user name.
1316-
For example, if user <literal>joe</> has password <literal>xyzzy</>,
1317-
<productname>&productname;</> will store the md5 hash of
1318-
<literal>xyzzyjoe</>. A password that does not follow that
1319-
format is assumed to be unencrypted.
1313+
is encrypted with MD5, this column will begin with the string
1314+
<literal>md5</> followed by a 32-character hexadecimal MD5 hash.
1315+
The MD5 hash will be of the user's password concatenated to their
1316+
user name. For example, if user <literal>joe</> has password
1317+
<literal>xyzzy</>, <productname>PostgreSQL</> will store the md5
1318+
hash of <literal>xyzzyjoe</>. If the password is encrypted with
1319+
SCRAM-SHA-256, it is built with 4 fields separated by a colon. The
1320+
first field is a salt encoded in base-64. The second field is the
1321+
number of iterations used to generate the password. The third field
1322+
is a stored key, encoded in hexadecimal. The fourth field is a
1323+
server key encoded in hexadecimal. A password that does not follow
1324+
any of those formats is assumed to be unencrypted.
13201325
</entry>
13211326
</row>
13221327

doc/src/sgml/client-auth.sgml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,17 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
420420
</listitem>
421421
</varlistentry>
422422

423+
<varlistentry>
424+
<term><literal>scram</></term>
425+
<listitem>
426+
<para>
427+
Require the client to supply a password encrypted with
428+
SCRAM-SHA-256 for authentication.
429+
See <xref linkend="auth-password"> for details.
430+
</para>
431+
</listitem>
432+
</varlistentry>
433+
423434
<varlistentry>
424435
<term><literal>password</></term>
425436
<listitem>
@@ -904,6 +915,17 @@ omicron bryanh guest1
904915
choice if one is depending on using SSL).
905916
</para>
906917

918+
<para>
919+
<literal>scram</> has more advantages than <literal>md5</> as it
920+
protects from cases where the hashed password is taken directly from
921+
<structname>pg_authid</structname> in which case a connection using
922+
only the stolen hash is possible without knowing the password behind
923+
it. It protects as well from password interception and data sniffing
924+
where the password data could be directly obtained from the network
925+
as well as man-in-the-middle (MITM) attacks. So it is strongly
926+
encouraged to use it over <literal>md5</> for password-based deployments.
927+
</para>
928+
907929
<para>
908930
<productname>&productname;</productname> database passwords are
909931
separate from operating system user passwords. The password for

doc/src/sgml/config.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ include_dir 'conf.d'
12541254
Authentication checks are always done with the server's user name
12551255
so authentication methods must be configured for the
12561256
server's user name, not the client's. Because
1257-
<literal>md5</> uses the user name as salt on both the
1257+
<literal>md5</>uses the user name as salt on both the
12581258
client and server, and <literal>scram</> uses the user name as
12591259
a portion of the salt used on both the client and server,
12601260
<literal>md5</> and <literal>scram</> cannot be used with

0 commit comments

Comments
 (0)