2016-01-12 23:52:30 +01:00
|
|
|
#pragma once
|
|
|
|
|
2016-02-06 14:45:38 +01:00
|
|
|
#define PASSWORD_PLAIN '0'
|
|
|
|
#define PASSWORD_MD5 '1'
|
|
|
|
#define PASSWORD_BCRYPT '2' // not implemented
|
|
|
|
#define PASSWORD_APACHE_MD5 'a'
|
|
|
|
#define PASSWORD_SHA256 '5' // not implemented
|
|
|
|
#define PASSWORD_SHA512 '6' // not implemented
|
2016-02-06 15:09:36 +01:00
|
|
|
#define PASSWORD_DEFAULT PASSWORD_APACHE_MD5
|
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);
|
|
|
|
const char * password_hash(const char *passwd, const char *salt, int algo);
|