postgresql/src
Noah Misch 0170b10dff Restore PGREQUIRESSL recognition in libpq.
Commit 65c3bf19fd moved handling of the,
already then, deprecated requiressl parameter into conninfo_storeval().
The default PGREQUIRESSL environment variable was however lost in the
change resulting in a potentially silent accept of a non-SSL connection
even when set.  Its documentation remained.  Restore its implementation.
Also amend the documentation to mark PGREQUIRESSL as deprecated for
those not following the link to requiressl.  Back-patch to 9.3, where
commit 65c3bf1 first appeared.

Behavior has been more complex when the user provides both deprecated
and non-deprecated settings.  Before commit 65c3bf1, libpq operated
according to the first of these found:

  requiressl=1
  PGREQUIRESSL=1
  sslmode=*
  PGSSLMODE=*

(Note requiressl=0 didn't override sslmode=*; it would only suppress
PGREQUIRESSL=1 or a previous requiressl=1.  PGREQUIRESSL=0 had no effect
whatsoever.)  Starting with commit 65c3bf1, libpq ignored PGREQUIRESSL,
and order of precedence changed to this:

  last of requiressl=* or sslmode=*
  PGSSLMODE=*

Starting now, adopt the following order of precedence:

  last of requiressl=* or sslmode=*
  PGSSLMODE=*
  PGREQUIRESSL=1

This retains the 65c3bf1 behavior for connection strings that contain
both requiressl=* and sslmode=*.  It retains the 65c3bf1 change that
either connection string option overrides both environment variables.
For the first time, PGSSLMODE has precedence over PGREQUIRESSL; this
avoids reducing security of "PGREQUIRESSL=1 PGSSLMODE=verify-full"
configurations originating under v9.3 and later.

Daniel Gustafsson

Security: CVE-2017-7485
2017-05-08 07:24:24 -07:00
..
backend Add security checks to selectivity estimation functions 2017-05-08 09:26:32 -04:00
bin Remove support for password_encryption='off' / 'plain'. 2017-05-08 11:26:07 +03:00
common Add PQencryptPasswordConn function to libpq, use it in psql and createuser. 2017-05-03 11:19:07 +03:00
fe_utils Allow psql variable substitution to occur in backtick command strings. 2017-04-01 21:44:54 -04:00
include Add security checks to selectivity estimation functions 2017-05-08 09:26:32 -04:00
interfaces Restore PGREQUIRESSL recognition in libpq. 2017-05-08 07:24:24 -07:00
makefiles Try to fix non-MSVC Windows builds in the wake of logical replication. 2017-01-20 12:51:31 -05:00
pl Improve castNode notation by introducing list-extraction-specific variants. 2017-04-10 13:51:53 -04:00
port Run the postmaster's signal handlers without SA_RESTART. 2017-04-24 13:00:30 -04:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Add security checks to selectivity estimation functions 2017-05-08 09:26:32 -04:00
timezone Guard against null t->tm_zone in strftime.c. 2017-05-07 12:33:12 -04:00
tools Install the "posixrules" timezone link in MSVC builds. 2017-05-07 11:57:41 -04:00
tutorial Recommend wrappers of PG_DETOAST_DATUM_PACKED(). 2017-03-12 19:35:33 -04:00
.gitignore
DEVELOPERS
Makefile Remove redundant coverage target 2017-02-17 08:56:57 -05:00
Makefile.global.in Remove use of Jade and DSSSL 2017-04-06 22:09:11 -04:00
Makefile.shlib Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00