[COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема [COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).
Дата
Msg-id E1clECL-0002jF-I1@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: [COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC5802 and 7677).  (Amit Kapila <amit.kapila16@gmail.com>)
Re: [COMMITTERS] pgsql: Support SCRAM-SHA-256 authentication (RFC5802 and 7677).  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-committers
Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).

This introduces a new generic SASL authentication method, similar to the
GSS and SSPI methods. The server first tells the client which SASL
authentication mechanism to use, and then the mechanism-specific SASL
messages are exchanged in AuthenticationSASLcontinue and PasswordMessage
messages. Only SCRAM-SHA-256 is supported at the moment, but this allows
adding more SASL mechanisms in the future, without changing the overall
protocol.

Support for channel binding, aka SCRAM-SHA-256-PLUS is left for later.

The SASLPrep algorithm, for pre-processing the password, is not yet
implemented. That could cause trouble, if you use a password with
non-ASCII characters, and a client library that does implement SASLprep.
That will hopefully be added later.

Authorization identities, as specified in the SCRAM-SHA-256 specification,
are ignored. SET SESSION AUTHORIZATION provides more or less the same
functionality, anyway.

If a user doesn't exist, perform a "mock" authentication, by constructing
an authentic-looking challenge on the fly. The challenge is derived from
a new system-wide random value, "mock authentication nonce", which is
created at initdb, and stored in the control file. We go through these
motions, in order to not give away the information on whether the user
exists, to unauthenticated users.

Bumps PG_CONTROL_VERSION, because of the new field in control file.

Patch by Michael Paquier and Heikki Linnakangas, reviewed at different
stages by Robert Haas, Stephen Frost, David Steele, Aleksander Alekseev,
and many others.

Discussion: https://www.postgresql.org/message-id/CAB7nPqRbR3GmFYdedCAhzukfKrgBLTLtMvENOmPrVWREsZkF8g%40mail.gmail.com
Discussion:
https://www.postgresql.org/message-id/CAB7nPqSMXU35g%3DW9X74HVeQp0uvgJxvYOuA4A-A3M%2B0wfEBv-w%40mail.gmail.com
Discussion: https://www.postgresql.org/message-id/55192AFE.6080106@iki.fi

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/818fd4a67d610991757b610755e3065fb99d80a5

Modified Files
--------------
contrib/pgcrypto/.gitignore                   |    4 -
contrib/pgcrypto/Makefile                     |   11 +-
doc/src/sgml/catalogs.sgml                    |   25 +-
doc/src/sgml/client-auth.sgml                 |   59 +-
doc/src/sgml/config.sgml                      |    7 +-
doc/src/sgml/protocol.sgml                    |  147 +++-
doc/src/sgml/ref/create_role.sgml             |   17 +-
src/backend/access/transam/xlog.c             |   24 +
src/backend/commands/user.c                   |   14 +-
src/backend/libpq/Makefile                    |    2 +-
src/backend/libpq/auth-scram.c                | 1032 +++++++++++++++++++++++++
src/backend/libpq/auth.c                      |  136 ++++
src/backend/libpq/crypt.c                     |   27 +-
src/backend/libpq/hba.c                       |    3 +
src/backend/libpq/pg_hba.conf.sample          |    8 +-
src/backend/utils/misc/guc.c                  |    1 +
src/backend/utils/misc/postgresql.conf.sample |    2 +-
src/bin/initdb/initdb.c                       |   21 +-
src/bin/pg_controldata/pg_controldata.c       |   12 +-
src/common/Makefile                           |    6 +-
src/common/base64.c                           |  199 +++++
src/common/scram-common.c                     |  196 +++++
src/include/access/xlog.h                     |    1 +
src/include/catalog/pg_control.h              |   11 +-
src/include/common/base64.h                   |   19 +
src/include/common/scram-common.h             |   62 ++
src/include/libpq/crypt.h                     |    3 +-
src/include/libpq/hba.h                       |    1 +
src/include/libpq/pqcomm.h                    |    2 +
src/include/libpq/scram.h                     |   35 +
src/interfaces/libpq/.gitignore               |    5 +
src/interfaces/libpq/Makefile                 |   20 +-
src/interfaces/libpq/fe-auth-scram.c          |  640 +++++++++++++++
src/interfaces/libpq/fe-auth.c                |  112 +++
src/interfaces/libpq/fe-auth.h                |    8 +
src/interfaces/libpq/fe-connect.c             |   52 ++
src/interfaces/libpq/libpq-int.h              |    7 +-
src/tools/msvc/Mkvcbuild.pm                   |   12 +-
38 files changed, 2866 insertions(+), 77 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: [COMMITTERS] pgsql: pg_dump: Properly handle public schema ACLs with --clean
Следующее
От: Simon Riggs
Дата:
Сообщение: [COMMITTERS] pgsql: Ensure ThisTimeLineID is valid before START_REPLICATION