* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.171 2006/05/04 16:07:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.172 2006/06/20 19:56:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "catalog/pg_authid.h"
#include "commands/comment.h"
#include "commands/user.h"
-#include "libpq/crypt.h"
+#include "libpq/md5.h"
#include "miscadmin.h"
#include "utils/acl.h"
#include "utils/builtins.h"
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/libpq/crypt.c,v 1.68 2006/03/05 15:58:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/crypt.c,v 1.69 2006/06/20 19:56:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "libpq/crypt.h"
#include "libpq/libpq.h"
+#include "libpq/md5.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "nodes/pg_list.h"
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.151 2006/03/06 17:41:43 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.152 2006/06/20 19:56:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include
-#include "libpq/crypt.h"
#include "libpq/libpq.h"
#include "miscadmin.h"
#include "nodes/pg_list.h"
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.35 2006/06/07 22:24:43 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.36 2006/06/20 19:56:52 tgl Exp $
*
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard , Linux Based Systems Design
/* This is intended to be used in both frontend and backend, so use c.h */
#include "c.h"
-#include
#include
#include
#include
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/md5.c,v 1.32 2006/03/05 15:58:27 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/md5.c,v 1.33 2006/06/20 19:56:52 tgl Exp $
*/
/* This is intended to be used in both frontend and backend, so use c.h */
#include "c.h"
-#include "libpq/crypt.h"
+#include "libpq/md5.h"
/*
*
* Calculates the MD5 sum of the bytes in a buffer.
*
- * SYNOPSIS #include "crypt.h"
+ * SYNOPSIS #include "md5.h"
* int pg_md5_hash(const void *buff, size_t len, char *hexsum)
*
* INPUT buff the buffer containing the bytes that you want
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.147 2006/05/21 20:05:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.148 2006/06/20 19:56:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "access/tuptoaster.h"
#include "catalog/pg_type.h"
#include "lib/stringinfo.h"
-#include "libpq/crypt.h"
+#include "libpq/md5.h"
#include "libpq/pqformat.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/libpq/crypt.h,v 1.34 2006/03/05 15:58:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/libpq/crypt.h,v 1.35 2006/06/20 19:56:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "libpq/libpq-be.h"
-#define MD5_PASSWD_LEN 35
-
-#define isMD5(passwd) (strncmp(passwd, "md5", 3) == 0 && \
- strlen(passwd) == MD5_PASSWD_LEN)
-
-
-/* in crypt.c */
extern int md5_crypt_verify(const Port *port, const char *user,
char *client_pass);
-/* in md5.c --- these are also present in frontend libpq */
-extern bool pg_md5_hash(const void *buff, size_t len, char *hexsum);
-extern bool pg_md5_encrypt(const char *passwd, const char *salt,
- size_t salt_len, char *buf);
-
#endif
* ip.h
* Definitions for IPv6-aware network access.
*
+ * These definitions are used by both frontend and backend code. Be careful
+ * what you include here!
+ *
* Copyright (c) 2003-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/libpq/ip.h,v 1.17 2006/03/05 15:58:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/libpq/ip.h,v 1.18 2006/06/20 19:56:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
--- /dev/null
+/*-------------------------------------------------------------------------
+ *
+ * md5.h
+ * Interface to libpq/md5.c
+ *
+ * These definitions are needed by both frontend and backend code to work
+ * with MD5-encrypted passwords.
+ *
+ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/include/libpq/md5.h,v 1.3 2006/06/20 19:56:52 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_MD5_H
+#define PG_MD5_H
+
+#define MD5_PASSWD_LEN 35
+
+#define isMD5(passwd) (strncmp(passwd, "md5", 3) == 0 && \
+ strlen(passwd) == MD5_PASSWD_LEN)
+
+
+extern bool pg_md5_hash(const void *buff, size_t len, char *hexsum);
+extern bool pg_md5_encrypt(const char *passwd, const char *salt,
+ size_t salt_len, char *buf);
+
+#endif
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.114 2006/03/06 17:59:30 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.115 2006/06/20 19:56:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "libpq-fe.h"
#include "libpq-int.h"
#include "fe-auth.h"
-#include "libpq/crypt.h"
+#include "libpq/md5.h"
#ifdef KRB5