#include "postgres.h"
#include "px-crypt.h"
Go to the source code of this file.
|
char * | _crypt_gensalt_traditional_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) |
|
char * | _crypt_gensalt_md5_rn (unsigned long count, const char *input, int size, char *output, int output_size) |
|
static void | BF_encode (char *dst, const BF_word *src, int size) |
|
char * | _crypt_gensalt_blowfish_rn (unsigned long count, const char *input, int size, char *output, int output_size) |
|
◆ BF_word
◆ _crypt_gensalt_blowfish_rn()
char* _crypt_gensalt_blowfish_rn |
( |
unsigned long |
count, |
|
|
const char * |
input, |
|
|
int |
size, |
|
|
char * |
output, |
|
|
int |
output_size |
|
) |
| |
Definition at line 161 of file crypt-gensalt.c.
164 if (size < 16 || output_size < 7 + 22 + 1 ||
165 (count && (count < 4 || count > 31)))
179 output[4] =
'0' + count / 10;
180 output[5] =
'0' + count % 10;
static void BF_encode(char *dst, const BF_word *src, int size)
References BF_encode(), input, and output.
◆ _crypt_gensalt_extended_rn()
char* _crypt_gensalt_extended_rn |
( |
unsigned long |
count, |
|
|
const char * |
input, |
|
|
int |
size, |
|
|
char * |
output, |
|
|
int |
output_size |
|
) |
| |
Definition at line 43 of file crypt-gensalt.c.
50 if (size < 3 || output_size < 1 + 4 + 4 + 1 ||
51 (count && (count > 0xffffff || !(count & 1))))
66 value = (
unsigned long) (
unsigned char)
input[0] |
67 ((
unsigned long) (
unsigned char)
input[1] << 8) |
68 ((
unsigned long) (
unsigned char)
input[2] << 16);
static unsigned char _crypt_itoa64[64+1]
References _crypt_itoa64, input, output, and value.
◆ _crypt_gensalt_md5_rn()
char* _crypt_gensalt_md5_rn |
( |
unsigned long |
count, |
|
|
const char * |
input, |
|
|
int |
size, |
|
|
char * |
output, |
|
|
int |
output_size |
|
) |
| |
Definition at line 79 of file crypt-gensalt.c.
84 if (size < 3 || output_size < 3 + 4 + 1 || (count && count != 1000))
94 value = (
unsigned long) (
unsigned char)
input[0] |
95 ((
unsigned long) (
unsigned char)
input[1] << 8) |
96 ((
unsigned long) (
unsigned char)
input[2] << 16);
103 if (size >= 6 && output_size >= 3 + 4 + 4 + 1)
105 value = (
unsigned long) (
unsigned char)
input[3] |
106 ((
unsigned long) (
unsigned char)
input[4] << 8) |
107 ((
unsigned long) (
unsigned char)
input[5] << 16);
References _crypt_itoa64, input, output, and value.
◆ _crypt_gensalt_traditional_rn()
char* _crypt_gensalt_traditional_rn |
( |
unsigned long |
count, |
|
|
const char * |
input, |
|
|
int |
size, |
|
|
char * |
output, |
|
|
int |
output_size |
|
) |
| |
◆ BF_encode()
static void BF_encode |
( |
char * |
dst, |
|
|
const BF_word * |
src, |
|
|
int |
size |
|
) |
| |
|
static |
Definition at line 124 of file crypt-gensalt.c.
126 const unsigned char *sptr = (
const unsigned char *) src;
127 const unsigned char *end = sptr + size;
128 unsigned char *dptr = (
unsigned char *) dst;
136 c1 = (c1 & 0x03) << 4;
146 c1 = (c2 & 0x0f) << 2;
157 }
while (sptr < end);
static unsigned char BF_itoa64[64+1]
References BF_itoa64.
Referenced by _crypt_gensalt_blowfish_rn().
◆ _crypt_itoa64
unsigned char _crypt_itoa64[64+1] |
|
static |
◆ BF_itoa64
unsigned char BF_itoa64[64+1] |
|
static |
Initial value:=
"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
Definition at line 120 of file crypt-gensalt.c.
Referenced by BF_encode().