|
@ -1,4 +1,4 @@ |
|
|
/* $OpenBSD: bcrypt.c,v 1.17 2003/06/25 21:16:47 deraadt Exp $ */ |
|
|
|
|
|
|
|
|
/* $OpenBSD: bcrypt.c,v 1.18 2003/08/07 00:28:45 deraadt Exp $ */ |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
* Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> |
|
|
* Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> |
|
@ -79,8 +79,7 @@ static char error[] = ":"; |
|
|
const static u_int8_t Base64Code[] = |
|
|
const static u_int8_t Base64Code[] = |
|
|
"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
|
|
"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
|
|
|
|
|
|
|
|
const static u_int8_t index_64[128] = |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
const static u_int8_t index_64[128] = { |
|
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
|
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
|
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
|
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
|
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
|
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
|
@ -172,12 +171,8 @@ bcrypt_gensalt(u_int8_t log_rounds) |
|
|
/* We handle $Vers$log2(NumRounds)$salt+passwd$ |
|
|
/* We handle $Vers$log2(NumRounds)$salt+passwd$ |
|
|
i.e. $2$04$iwouldntknowwhattosayetKdJ6iFtacBqJdKe6aW7ou */ |
|
|
i.e. $2$04$iwouldntknowwhattosayetKdJ6iFtacBqJdKe6aW7ou */ |
|
|
|
|
|
|
|
|
char *bcrypt(const char *key, const char *salt); |
|
|
|
|
|
|
|
|
|
|
|
char * |
|
|
char * |
|
|
bcrypt(key, salt) |
|
|
|
|
|
const char *key; |
|
|
|
|
|
const char *salt; |
|
|
|
|
|
|
|
|
bcrypt(const char *key, const char *salt) |
|
|
{ |
|
|
{ |
|
|
blf_ctx state; |
|
|
blf_ctx state; |
|
|
u_int32_t rounds, i, k; |
|
|
u_int32_t rounds, i, k; |
|
|