From 31f5b24e4b336ed37eba108423576cbbf3c4098c Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 28 Oct 2008 12:10:44 +0000 Subject: [PATCH] Remove support for (insecure) crypt authentication. This breaks compatibility with pre-7.2 versions. --- doc/src/sgml/client-auth.sgml | 35 ++------------- doc/src/sgml/protocol.sgml | 68 ----------------------------- doc/src/sgml/user-manag.sgml | 4 +- src/backend/libpq/auth.c | 8 ---- src/backend/libpq/crypt.c | 16 ------- src/backend/libpq/hba.c | 2 - src/backend/postmaster/postmaster.c | 39 +++-------------- src/include/libpq/hba.h | 1 - src/include/libpq/libpq-be.h | 1 - src/include/libpq/pqcomm.h | 2 +- src/interfaces/libpq/fe-auth.c | 18 +++----- src/interfaces/libpq/fe-connect.c | 9 ---- src/interfaces/libpq/libpq-int.h | 1 - 13 files changed, 17 insertions(+), 187 deletions(-) diff --git a/doc/src/sgml/client-auth.sgml b/doc/src/sgml/client-auth.sgml index 50bf1ce42b..733b6bafd8 100644 --- a/doc/src/sgml/client-auth.sgml +++ b/doc/src/sgml/client-auth.sgml @@ -315,24 +315,6 @@ hostnossl database user - - crypt - - - - This option is recommended only for communicating with pre-7.2 - clients. - - - - Require the client to supply a crypt()-encrypted - password for authentication. - md5 is now recommended over crypt. - See for details. - - - - password @@ -704,9 +686,6 @@ omicron bryanh guest1 MD5 - - crypt - password authentication @@ -714,21 +693,15 @@ omicron bryanh guest1 The password-based authentication methods are md5, - crypt, and password. These methods operate + and password. These methods operate similarly except for the way that the password is sent across the - connection: respectively, MD5-hashed, crypt-encrypted, and clear-text. - A limitation is that the crypt method does not work with - passwords that have been encrypted in pg_authid. + connection: respectively, MD5-hashed and clear-text. If you are at all concerned about password - sniffing attacks then md5 is preferred, with - crypt to be used only if you must support pre-7.2 - clients. Plain password should be avoided especially for - connections over the open Internet (unless you use SSL, - SSH, or another - communications security wrapper around the connection). + sniffing attacks then md5 is preferred. + Plain password should always be avoided if possible. diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 14b5e9ac19..342be652ce 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -295,19 +295,6 @@ - - AuthenticationCryptPassword - - - The frontend must now send a PasswordMessage containing the - password encrypted via crypt(3), using the 2-character salt - specified in the AuthenticationCryptPassword message. If - this is the correct password, the server responds with an - AuthenticationOk, otherwise it responds with an ErrorResponse. - - - - AuthenticationMD5Password @@ -1531,61 +1518,6 @@ AuthenticationCleartextPassword (B) - - -AuthenticationCryptPassword (B) - - - - - - - - Byte1('R') - - - - Identifies the message as an authentication request. - - - - - - Int32(10) - - - - Length of message contents in bytes, including self. - - - - - - Int32(4) - - - - Specifies that a crypt()-encrypted password is required. - - - - - - Byte2 - - - - The salt to use when encrypting the password. - - - - - - - - - - AuthenticationMD5Password (B) diff --git a/doc/src/sgml/user-manag.sgml b/doc/src/sgml/user-manag.sgml index 357e00c352..594e574a05 100644 --- a/doc/src/sgml/user-manag.sgml +++ b/doc/src/sgml/user-manag.sgml @@ -215,8 +215,8 @@ CREATE USER name; A password is only significant if the client authentication method requires the user to supply a password when connecting - to the database. The