#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) |
|
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 |
|
) |
| |
Definition at line 90 of file px-crypt.c.
98 if (strncmp(salt,
c->id,
c->id_len) == 0)
102 if (
c->crypt == NULL)
105 return c->crypt(psw, salt,
buf,
len);
static const struct px_crypt_algo px_crypt_list[]
Referenced by pg_crypt().
◆ px_gen_salt()
int px_gen_salt |
( |
const char * |
salt_type, |
|
|
char * |
buf, |
|
|
int |
rounds |
|
) |
| |
Definition at line 132 of file px-crypt.c.
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, 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.
char * _crypt_blowfish_rn(const char *key, const char *setting, char *output, int size)
static void PGresult * res
◆ run_crypt_des()
static char* run_crypt_des |
( |
const char * |
psw, |
|
|
const char * |
salt, |
|
|
char * |
buf, |
|
|
unsigned |
len |
|
) |
| |
|
static |
◆ run_crypt_md5()
static char* run_crypt_md5 |
( |
const char * |
psw, |
|
|
const char * |
salt, |
|
|
char * |
buf, |
|
|
unsigned |
len |
|
) |
| |
|
static |
◆ gen_list
Initial value:= {
{NULL, NULL, 0, 0, 0, 0}
}
char * _crypt_gensalt_extended_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_md5_rn(unsigned long count, const char *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)
Definition at line 90 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_md5(const char *psw, const char *salt, char *buf, unsigned len)
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)
Definition at line 61 of file px-crypt.c.