diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-08-15 18:42:16 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-08-15 18:42:16 +0000 |
commit | 38bb1abcda9119957e836f731a1cfea6d2079499 (patch) | |
tree | 8f61d7b57cc171d8307a81dc7c4b7a382be58f43 /src/backend/libpq/password.c | |
parent | 397f65d102b7f9998411f2a8c2d1c66dfe712320 (diff) | |
download | postgresql-38bb1abcda9119957e836f731a1cfea6d2079499.tar.gz postgresql-38bb1abcda9119957e836f731a1cfea6d2079499.zip |
Use MD5 for wire protocol encryption for >= 7.2 client/server.
Allow pg_shadow to be MD5 encrypted.
Add ENCRYPTED/UNENCRYPTED option to CREATE/ALTER user.
Add password_encryption postgresql.conf option.
Update wire protocol version to 2.1.
Diffstat (limited to 'src/backend/libpq/password.c')
-rw-r--r-- | src/backend/libpq/password.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/backend/libpq/password.c b/src/backend/libpq/password.c index 2d4559a296c..e98ab6bc0af 100644 --- a/src/backend/libpq/password.c +++ b/src/backend/libpq/password.c @@ -2,7 +2,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: password.c,v 1.37 2001/06/18 16:11:30 momjian Exp $ + * $Id: password.c,v 1.38 2001/08/15 18:42:15 momjian Exp $ * */ @@ -82,11 +82,14 @@ verify_password(const Port *port, const char *user, const char *password) * the current code needs non-encrypted passwords to * encrypt with a random salt. */ - if (port->auth_method == uaCrypt - || test_pw == NULL || test_pw[0] == '\0' - || strcmp(test_pw, "+") == 0) - return crypt_verify(port, user, password); - + if (port->auth_method == uaCrypt || + port->auth_method == uaMD5 || + test_pw == NULL || + test_pw[0] == '\0' || + strcmp(test_pw, "+") == 0) + return md5_crypt_verify(port, user, password); + + /* external password file is crypt-only */ if (strcmp(crypt(password, test_pw), test_pw) == 0) { /* it matched. */ |