2016-01-12 23:52:30 +01:00
|
|
|
#pragma once
|
|
|
|
|
2017-01-10 18:05:48 +01:00
|
|
|
#include <stdbool.h>
|
2016-02-16 07:30:26 +01:00
|
|
|
#define PASSWORD_PLAINTEXT 0
|
|
|
|
#define PASSWORD_DEFAULT PASSWORD_PLAINTEXT
|
2016-01-13 16:16:02 +01:00
|
|
|
|
2016-01-12 23:52:30 +01:00
|
|
|
#define VERIFY_OK 0 // password matches hash
|
|
|
|
#define VERIFY_FAIL 1 // password is wrong
|
|
|
|
#define VERIFY_UNKNOWN 2 // hashing algorithm not supported
|
2016-01-14 15:49:09 +01:00
|
|
|
int password_verify(const char *hash, const char *passwd);
|
2016-02-16 07:30:26 +01:00
|
|
|
const char * password_encode(const char *passwd, int algo);
|
2016-02-25 10:46:46 +01:00
|
|
|
bool password_is_implemented(int algo);
|