PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
crypt.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * crypt.h
4  * Interface to libpq/crypt.c
5  *
6  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/libpq/crypt.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PG_CRYPT_H
14 #define PG_CRYPT_H
15 
16 #include "datatype/timestamp.h"
17 
18 /*
19  * Types of password hashes or verifiers that can be stored in
20  * pg_authid.rolpassword.
21  *
22  * This is also used for the password_encryption GUC.
23  */
24 typedef enum PasswordType
25 {
28 } PasswordType;
29 
30 extern PasswordType get_password_type(const char *shadow_pass);
31 extern char *encrypt_password(PasswordType target_type, const char *role,
32  const char *password);
33 
34 extern int get_role_password(const char *role, char **shadow_pass,
35  char **logdetail);
36 
37 extern int md5_crypt_verify(const char *role, const char *shadow_pass,
38  const char *client_pass, const char *md5_salt,
39  int md5_salt_len, char **logdetail);
40 extern int plain_crypt_verify(const char *role, const char *shadow_pass,
41  const char *client_pass, char **logdetail);
42 
43 #endif
static char password[100]
Definition: streamutil.c:41
int plain_crypt_verify(const char *role, const char *shadow_pass, const char *client_pass, char **logdetail)
Definition: crypt.c:255
PasswordType get_password_type(const char *shadow_pass)
Definition: crypt.c:110
int get_role_password(const char *role, char **shadow_pass, char **logdetail)
Definition: crypt.c:43
int md5_crypt_verify(const char *role, const char *shadow_pass, const char *client_pass, const char *md5_salt, int md5_salt_len, char **logdetail)
Definition: crypt.c:178
PasswordType
Definition: crypt.h:24
char * encrypt_password(PasswordType target_type, const char *role, const char *password)
Definition: crypt.c:126