From 53a5026b5cb359ec31e81fa6b20a69b053b87569 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 | 37 +++------------ doc/src/sgml/protocol.sgml | 70 +---------------------------- doc/src/sgml/user-manag.sgml | 6 +-- src/backend/libpq/auth.c | 10 +---- src/backend/libpq/crypt.c | 18 +------- src/backend/libpq/hba.c | 4 +- src/backend/postmaster/postmaster.c | 41 +++-------------- src/include/libpq/hba.h | 3 +- src/include/libpq/libpq-be.h | 3 +- src/include/libpq/pqcomm.h | 4 +- src/interfaces/libpq/fe-auth.c | 20 +++------ src/interfaces/libpq/fe-connect.c | 11 +---- src/interfaces/libpq/libpq-int.h | 3 +- 13 files changed, 30 insertions(+), 200 deletions(-) diff --git a/doc/src/sgml/client-auth.sgml b/doc/src/sgml/client-auth.sgml index 5a308eb8958..93482be6eab 100644 --- a/doc/src/sgml/client-auth.sgml +++ b/doc/src/sgml/client-auth.sgml @@ -1,4 +1,4 @@ - + Client Authentication @@ -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 0797812c000..c9a0c7abde7 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1,4 +1,4 @@ - + Frontend/Backend Protocol @@ -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 d4d9fcc5150..7023c2c724a 100644 --- a/doc/src/sgml/user-manag.sgml +++ b/doc/src/sgml/user-manag.sgml @@ -1,4 +1,4 @@ - + Database Roles and Privileges @@ -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