1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

Add 4-byte MD5 salt.

This commit is contained in:
Bruce Momjian
2001-08-17 02:59:20 +00:00
parent a61e15a566
commit da45a0bdb7
11 changed files with 89 additions and 43 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.59 2001/08/16 16:24:15 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.60 2001/08/17 02:59:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -536,10 +536,17 @@ sendAuthRequest(Port *port, AuthRequest areq)
pq_sendint(&buf, (int32) areq, sizeof(int32));
/* Add the salt for encrypted passwords. */
if (areq == AUTH_REQ_CRYPT || areq == AUTH_REQ_MD5)
if (areq == AUTH_REQ_MD5)
{
pq_sendint(&buf, port->salt[0], 1);
pq_sendint(&buf, port->salt[1], 1);
pq_sendint(&buf, port->md5Salt[0], 1);
pq_sendint(&buf, port->md5Salt[1], 1);
pq_sendint(&buf, port->md5Salt[2], 1);
pq_sendint(&buf, port->md5Salt[3], 1);
}
if (areq == AUTH_REQ_CRYPT)
{
pq_sendint(&buf, port->cryptSalt[0], 1);
pq_sendint(&buf, port->cryptSalt[1], 1);
}
pq_endmessage(&buf);