#include "postgres.h"
#include "px-crypt.h"
#include "px.h"
Go to the source code of this file.
|
static char * | run_crypt_des (const char *psw, const char *salt, char *buf, unsigned len) |
|
static char * | run_crypt_md5 (const char *psw, const char *salt, char *buf, unsigned len) |
|
static char * | run_crypt_bf (const char *psw, const char *salt, char *buf, unsigned len) |
|
static char * | run_crypt_sha (const char *psw, const char *salt, char *buf, unsigned len) |
|
char * | px_crypt (const char *psw, const char *salt, char *buf, unsigned len) |
|
int | px_gen_salt (const char *salt_type, char *buf, int rounds) |
|
◆ px_crypt()
char * px_crypt |
( |
const char * |
psw, |
|
|
const char * |
salt, |
|
|
char * |
buf, |
|
|
unsigned |
len |
|
) |
| |
◆ px_gen_salt()
int px_gen_salt |
( |
const char * |
salt_type, |
|
|
char * |
buf, |
|
|
int |
rounds |
|
) |
| |
Definition at line 156 of file px-crypt.c.
157{
159 char *p;
160 char rbuf[16];
161
163
166 break;
167
170
172 {
173 if (rounds == 0)
175
178 }
179
182
185
186 if (p == NULL)
188
189 return strlen(p);
190}
bool pg_strong_random(void *buf, size_t len)
int pg_strcasecmp(const char *s1, const char *s2)
static struct generator gen_list[]
void px_memset(void *ptr, int c, size_t len)
#define PXE_BAD_SALT_ROUNDS
#define PXE_UNKNOWN_SALT_ALGO
char *(* gen)(unsigned long count, const char *input, int size, char *output, int output_size)
References buf, CheckBuiltinCryptoMode(), generator::def_rounds, generator::gen, gen_list, generator::input_len, generator::max_rounds, generator::min_rounds, generator::name, pg_strcasecmp(), pg_strong_random(), PX_MAX_SALT_LEN, px_memset(), PXE_BAD_SALT_ROUNDS, PXE_NO_RANDOM, and PXE_UNKNOWN_SALT_ALGO.
Referenced by pg_gen_salt(), and pg_gen_salt_rounds().
◆ run_crypt_bf()
static char * run_crypt_bf |
( |
const char * |
psw, |
|
|
const char * |
salt, |
|
|
char * |
buf, |
|
|
unsigned |
len |
|
) |
| |
|
static |
Definition at line 61 of file px-crypt.c.
63{
64 char *res;
65
67 return res;
68}
char * _crypt_blowfish_rn(const char *key, const char *setting, char *output, int size)
References _crypt_blowfish_rn(), buf, and len.
◆ run_crypt_des()
static char * run_crypt_des |
( |
const char * |
psw, |
|
|
const char * |
salt, |
|
|
char * |
buf, |
|
|
unsigned |
len |
|
) |
| |
|
static |
Definition at line 38 of file px-crypt.c.
40{
41 char *res;
42
44 if (res == NULL || strlen(res) >
len - 1)
45 return NULL;
48}
char * px_crypt_des(const char *key, const char *setting)
References buf, len, and px_crypt_des().
◆ run_crypt_md5()
static char * run_crypt_md5 |
( |
const char * |
psw, |
|
|
const char * |
salt, |
|
|
char * |
buf, |
|
|
unsigned |
len |
|
) |
| |
|
static |
Definition at line 51 of file px-crypt.c.
53{
54 char *res;
55
57 return res;
58}
char * px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen)
References buf, len, and px_crypt_md5().
◆ run_crypt_sha()
static char * run_crypt_sha |
( |
const char * |
psw, |
|
|
const char * |
salt, |
|
|
char * |
buf, |
|
|
unsigned |
len |
|
) |
| |
|
static |
Definition at line 71 of file px-crypt.c.
73{
74 char *res;
75
77 return res;
78}
char * px_crypt_shacrypt(const char *pw, const char *salt, char *passwd, unsigned dstlen)
References buf, len, and px_crypt_shacrypt().
◆ gen_list
Initial value:= {
{
},
{
},
{NULL, NULL, 0, 0, 0, 0}
}
char * _crypt_gensalt_sha512_rn(unsigned long count, char const *input, int size, char *output, int output_size)
char * _crypt_gensalt_traditional_rn(unsigned long count, const char *input, int size, char *output, int output_size)
char * _crypt_gensalt_sha256_rn(unsigned long count, const char *input, int size, char *output, int output_size)
char * _crypt_gensalt_md5_rn(unsigned long count, const char *input, int size, char *output, int output_size)
char * _crypt_gensalt_blowfish_rn(unsigned long count, const char *input, int size, char *output, int output_size)
char * _crypt_gensalt_extended_rn(unsigned long count, const char *input, int size, char *output, int output_size)
#define PX_SHACRYPT_ROUNDS_MAX
#define PX_SHACRYPT_ROUNDS_MIN
#define PX_SHACRYPT_SALT_MAX_LEN
#define PX_SHACRYPT_ROUNDS_DEFAULT
Definition at line 137 of file px-crypt.c.
Referenced by px_gen_salt().
◆ px_crypt_list
Initial value:= {
{"$2$", 3, NULL},
{NULL, 0, NULL}
}
static char * run_crypt_des(const char *psw, const char *salt, char *buf, unsigned len)
static char * run_crypt_bf(const char *psw, const char *salt, char *buf, unsigned len)
static char * run_crypt_md5(const char *psw, const char *salt, char *buf, unsigned len)
static char * run_crypt_sha(const char *psw, const char *salt, char *buf, unsigned len)
Definition at line 89 of file px-crypt.c.
Referenced by px_crypt().