version 1.23, 2006/03/30 21:06:29 |
version 1.24, 2006/04/02 01:00:18 |
|
|
#include <time.h> |
#include <time.h> |
#include <login_cap.h> |
#include <login_cap.h> |
|
|
void to64(char *, int32_t, int n); |
static void to64(char *, u_int32_t, int n); |
char *bcrypt_gensalt(u_int8_t); |
char *bcrypt_gensalt(u_int8_t); |
int pwd_gensalt(char *, int, login_cap_t *, char); |
int pwd_gensalt(char *, int, login_cap_t *, char); |
|
|
#define YPCIPHER_DEF "old" |
#define YPCIPHER_DEF "old" |
#define LOCALCIPHER_DEF "blowfish,6" |
#define LOCALCIPHER_DEF "blowfish,6" |
|
|
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ |
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ |
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
|
|
void |
static void |
to64(char *s, int32_t v, int n) |
to64(char *s, u_int32_t v, int n) |
{ |
{ |
while (--n >= 0) { |
while (--n >= 0) { |
*s++ = itoa64[v&0x3f]; |
*s++ = itoa64[v&0x3f]; |
(unsigned)v >>= 6; |
v >>= 6; |
} |
} |
} |
} |