summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2001-08-15 21:08:21 +0000
committerBruce Momjian2001-08-15 21:08:21 +0000
commit991192f0c3651ad73024d95d8938fcb10eefedcc (patch)
tree73029882bb6f8d022eebdd48b13a2f574bf1af81
parent037efcc48dd0bf502a7284b289d9cad7a48e9abb (diff)
Move md5.h contents to crypt.h.
-rw-r--r--src/backend/commands/user.c1
-rw-r--r--src/backend/libpq/crypt.c1
-rw-r--r--src/backend/libpq/md5.c4
-rw-r--r--src/include/libpq/crypt.h9
-rw-r--r--src/include/libpq/md5.h21
-rw-r--r--src/interfaces/libpq/Makefile5
-rw-r--r--src/interfaces/libpq/fe-auth.c2
7 files changed, 13 insertions, 30 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 5844c76c20..5c3a05d8ee 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -25,7 +25,6 @@
#include "catalog/indexing.h"
#include "commands/user.h"
#include "libpq/crypt.h"
-#include "libpq/md5.h"
#include "miscadmin.h"
#include "utils/array.h"
#include "utils/builtins.h"
diff --git a/src/backend/libpq/crypt.c b/src/backend/libpq/crypt.c
index a54a9d397d..4666f2150d 100644
--- a/src/backend/libpq/crypt.c
+++ b/src/backend/libpq/crypt.c
@@ -19,7 +19,6 @@
#include "postgres.h"
#include "libpq/crypt.h"
-#include "libpq/md5.h"
#include "miscadmin.h"
#include "storage/fd.h"
#include "utils/nabstime.h"
diff --git a/src/backend/libpq/md5.c b/src/backend/libpq/md5.c
index 20392fb4e7..4412744249 100644
--- a/src/backend/libpq/md5.c
+++ b/src/backend/libpq/md5.c
@@ -18,7 +18,7 @@
#include <errno.h>
#include "postgres.h"
-#include "libpq/md5.h"
+#include "libpq/crypt.h"
/*
* PRIVATE FUNCTIONS
@@ -249,7 +249,7 @@ bytesToHex(unsigned8 b[16], char *s)
*
* Calculates the MD5 sum of the bytes in a buffer.
*
- * SYNOPSIS #include "md5.h"
+ * SYNOPSIS #include "crypt.h"
* int md5_hash(const void *buff, size_t len, char *hexsum)
*
* INPUT buff the buffer containing the bytes that you want
diff --git a/src/include/libpq/crypt.h b/src/include/libpq/crypt.h
index 030921c254..86b9f2497c 100644
--- a/src/include/libpq/crypt.h
+++ b/src/include/libpq/crypt.h
@@ -24,4 +24,13 @@ extern char *crypt_getpwdreloadfilename(void);
extern int md5_crypt_verify(const Port *port, const char *user, const char *pgpass);
+extern bool md5_hash(const void *buff, size_t len, char *hexsum);
+extern bool CheckMD5Pwd(char *passwd, char *storedpwd, char *seed);
+extern bool EncryptMD5(const char *passwd, const char *salt, char *buf);
+
+#define MD5_PASSWD_LEN 35
+
+#define isMD5(passwd) (strncmp((passwd),"md5",3) == 0 && \
+ strlen(passwd) == MD5_PASSWD_LEN)
+
#endif
diff --git a/src/include/libpq/md5.h b/src/include/libpq/md5.h
deleted file mode 100644
index c30ad0ce61..0000000000
--- a/src/include/libpq/md5.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * md5.h
- * Interface to hba.c
- *
- *
- *-------------------------------------------------------------------------
- */
-#ifndef PG_MD5_H
-#define PG_MD5_H
-
-extern bool md5_hash(const void *buff, size_t len, char *hexsum);
-extern bool CheckMD5Pwd(char *passwd, char *storedpwd, char *seed);
-extern bool EncryptMD5(const char *passwd, const char *salt, char *buf);
-
-#define MD5_PASSWD_LEN 35
-
-#define isMD5(passwd) (strncmp((passwd),"md5",3) == 0 && \
- strlen(passwd) == MD5_PASSWD_LEN)
-
-#endif
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index bde10d2506..95d77027d3 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -33,7 +33,7 @@ endif
SHLIB_LINK += $(filter -L%, $(LDFLAGS)) $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS))
-all: md5.c md5.h all-lib
+all: md5.c all-lib
# Shared library stuff
include $(top_srcdir)/src/Makefile.shlib
@@ -52,9 +52,6 @@ dllist.c: $(backend_src)/lib/dllist.c
md5.c: $(backend_src)/libpq/md5.c
rm -f $@ && $(LN_S) $< .
-md5.h: $(backend_src)/../include/libpq/md5.h
- rm -f $@ && $(LN_S) $< .
-
# this only gets done if configure finds system doesn't have inet_aton()
inet_aton.c: $(backend_src)/port/inet_aton.c
rm -f $@ && $(LN_S) $< .
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c
index fb56ccf052..33bd1f0cc6 100644
--- a/src/interfaces/libpq/fe-auth.c
+++ b/src/interfaces/libpq/fe-auth.c
@@ -33,7 +33,7 @@
#include "libpq-fe.h"
#include "libpq-int.h"
#include "fe-auth.h"
-#include "md5.h"
+#include "libpq/crypt.h"
#ifdef WIN32
#include "win32.h"