A little more code reorg for MD5/crypt.
authorBruce Momjian
Fri, 17 Aug 2001 15:44:17 +0000 (15:44 +0000)
committerBruce Momjian
Fri, 17 Aug 2001 15:44:17 +0000 (15:44 +0000)
src/backend/libpq/auth.c
src/backend/libpq/password.c

index 1f60d13731e88b00ce2d4fe473260725700e91d7..42078e29834c5f7e64e3e6a8da17149b9b01b7a0 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.61 2001/08/17 15:40:07 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.62 2001/08/17 15:44:17 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -419,9 +419,9 @@ auth_failed(Port *port)
        case uaIdent:
            authmethod = "IDENT";
            break;
-       case uaPassword:
        case uaMD5:
        case uaCrypt:
+       case uaPassword:
            authmethod = "Password";
            break;
    }
@@ -496,11 +496,6 @@ ClientAuthentication(Port *port)
            status = authident(port);
            break;
 
-       case uaPassword:
-           sendAuthRequest(port, AUTH_REQ_PASSWORD);
-           status = recv_and_check_password_packet(port);
-           break;
-
        case uaMD5:
            sendAuthRequest(port, AUTH_REQ_MD5);
            status = recv_and_check_password_packet(port);
@@ -511,6 +506,11 @@ ClientAuthentication(Port *port)
            status = recv_and_check_password_packet(port);
            break;
 
+       case uaPassword:
+           sendAuthRequest(port, AUTH_REQ_PASSWORD);
+           status = recv_and_check_password_packet(port);
+           break;
+
        case uaTrust:
            status = STATUS_OK;
            break;
index e98ab6bc0af7201fb0f68c5ce16afba54df67d2b..4dde3afe99c401c74b140e37974e129e7d4fd48f 100644 (file)
@@ -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.38 2001/08/15 18:42:15 momjian Exp $
+ * $Id: password.c,v 1.39 2001/08/17 15:44:17 momjian Exp $
  *
  */
 
@@ -82,8 +82,8 @@ 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 ||
-               port->auth_method == uaMD5 ||
+           if (port->auth_method == uaMD5 ||
+               port->auth_method == uaCrypt ||
                test_pw == NULL ||
                test_pw[0] == '\0' ||
                strcmp(test_pw, "+") == 0)