|
@ -34,29 +34,15 @@ |
|
|
// fprintf(stderr, "\"\n");
|
|
|
// fprintf(stderr, "\"\n");
|
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
#include "bcrypt.h" |
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) { // ClearDNS server
|
|
|
int main(int argc, char *argv[]) { // ClearDNS server
|
|
|
|
|
|
|
|
|
LOG_LEVEL = LOG_DEBUG; |
|
|
LOG_LEVEL = LOG_DEBUG; |
|
|
log_info("ClearDNS server start (%s)", VERSION); |
|
|
log_info("ClearDNS server start (%s)", VERSION); |
|
|
|
|
|
|
|
|
|
|
|
char *ret = gen_bcrypt("dnomd343"); |
|
|
char salt[BCRYPT_HASHSIZE]; |
|
|
log_info("%s", ret); |
|
|
log_info("size -> %d", BCRYPT_HASHSIZE); |
|
|
|
|
|
int ret = bcrypt_gensalt(10, salt); |
|
|
|
|
|
log_info("gensalt ret -> %d", ret); |
|
|
|
|
|
log_info("salt -> %s", salt); |
|
|
|
|
|
|
|
|
|
|
|
char passwd[] = "dnomd343"; |
|
|
|
|
|
log_info("passwd -> %s", passwd); |
|
|
|
|
|
char hash[BCRYPT_HASHSIZE]; |
|
|
|
|
|
ret = bcrypt_hashpw(passwd, salt, hash); |
|
|
|
|
|
log_info("hashpw ret -> %d", ret); |
|
|
|
|
|
log_info("hash -> %s", hash); |
|
|
|
|
|
|
|
|
|
|
|
ret = bcrypt_checkpw(passwd, hash); |
|
|
|
|
|
log_info("checkpw ret -> %d", ret); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// load_config("test.json");
|
|
|
// load_config("test.json");
|
|
|