OSDN Git Service

Move md5.h contents to crypt.h.
[pg-rex/syncrep.git] / src / include / libpq / crypt.h
1 /*-------------------------------------------------------------------------
2  *
3  * crypt.h
4  *        Interface to hba.c
5  *
6  *
7  *-------------------------------------------------------------------------
8  */
9 #ifndef PG_CRYPT_H
10 #define PG_CRYPT_H
11
12 #include "libpq/libpq-be.h"
13
14 #define CRYPT_PWD_FILE  "pg_pwd"
15 #define CRYPT_PWD_FILE_SEPCHAR  "'\\t'"
16 #define CRYPT_PWD_FILE_SEPSTR   "\t"
17 #define CRYPT_PWD_RELOAD_SUFX   ".reload"
18
19 extern char **pwd_cache;
20 extern int      pwd_cache_count;
21
22 extern char *crypt_getpwdfilename(void);
23 extern char *crypt_getpwdreloadfilename(void);
24
25 extern int md5_crypt_verify(const Port *port, const char *user, const char *pgpass);
26
27 extern bool md5_hash(const void *buff, size_t len, char *hexsum);
28 extern bool CheckMD5Pwd(char *passwd, char *storedpwd, char *seed);
29 extern bool EncryptMD5(const char *passwd, const char *salt, char *buf);
30
31 #define MD5_PASSWD_LEN  35
32
33 #define isMD5(passwd)   (strncmp((passwd),"md5",3) == 0 && \
34                                                  strlen(passwd) == MD5_PASSWD_LEN)
35
36 #endif