#include "postgres.h"
#include "px-crypt.h"
#include "px.h"
Go to the source code of this file.
|
static void | _crypt_to64 (char *s, unsigned long v, int n) |
|
char * | px_crypt_md5 (const char *pw, const char *salt, char *passwd, unsigned dstlen) |
|
◆ MD5_SIZE
◆ _crypt_to64()
static void _crypt_to64 |
( |
char * |
s, |
|
|
unsigned long |
v, |
|
|
int |
n |
|
) |
| |
|
static |
◆ px_crypt_md5()
char* px_crypt_md5 |
( |
const char * |
pw, |
|
|
const char * |
salt, |
|
|
char * |
passwd, |
|
|
unsigned |
dstlen |
|
) |
| |
Definition at line 34 of file crypt-md5.c.
36 static char *magic =
"$1$";
40 static const char *sp,
51 if (!passwd || dstlen < 120)
58 if (strncmp(sp, magic, strlen(magic)) == 0)
62 for (ep = sp; *ep && *ep !=
'$' && ep < (sp + 8); ep++)
94 for (pl = strlen(pw); pl > 0; pl -=
MD5_SIZE)
101 for (
i = strlen(pw);
i;
i >>= 1)
108 strcpy(passwd, magic);
109 strncat(passwd, sp, sl);
119 for (
i = 0;
i < 1000;
i++)
140 p = passwd + strlen(passwd);
142 l = (
final[0] << 16) | (
final[6] << 8) |
final[12];
145 l = (
final[1] << 16) | (
final[7] << 8) |
final[13];
148 l = (
final[2] << 16) | (
final[8] << 8) |
final[14];
151 l = (
final[3] << 16) | (
final[9] << 8) |
final[15];
154 l = (
final[4] << 16) | (
final[10] << 8) |
final[5];
static void _crypt_to64(char *s, unsigned long v, int n)
void err(int eval, const char *fmt,...)
int px_find_digest(const char *name, PX_MD **res)
void px_memset(void *ptr, int c, size_t len)
#define px_md_finish(md, buf)
#define px_md_update(md, data, dlen)
References _crypt_to64(), err(), i, MD5_SIZE, px_find_digest(), px_md_finish, px_md_free, px_md_reset, px_md_update, and px_memset().
Referenced by run_crypt_md5().
◆ _crypt_a64
Initial value:=
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
Definition at line 16 of file crypt-md5.c.
Referenced by _crypt_to64().