X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=common%2Fauth.h;h=9d3fe499d036cc69560f7ca052bfa281d131bfaf;hb=abeaeafe6860bef22ab8469261d3198efc8358c1;hp=647bd6fb3c94c83d506b03d4db6298561155534a;hpb=30465019b067284f33ffe514e970edcf3ca6f1e5;p=blerg.git diff --git a/common/auth.h b/common/auth.h index 647bd6f..9d3fe49 100644 --- a/common/auth.h +++ b/common/auth.h @@ -4,9 +4,21 @@ #ifndef _AUTH_H #define _AUTH_H -int auth_set_password(const char *, const char *); -int auth_get_password(const char *, char *); -int auth_check_password(const char *, const char *); +#include + +#define TOKEN_SIZE 16 +#define MAX_PASSWORD_LENGTH 64 +#define SCRYPT_SALT_SIZE 8 +#define SCRYPT_OUTPUT_SIZE 32 +#define SCRYPT_N 1<<14 +#define SCRYPT_r 8 +#define SCRYPT_p 1 + +int auth_set_password(const char *username, const char *password); +int auth_get_password_version(const char *username); +int auth_get_password(const char *username, char *password); +int auth_get_salt(const char *username, uint8_t *salt); +int auth_check_password(const char *username, const char *password); char * auth_login(const char *username, const char *password); int auth_logout(const char *username, const char *token); int auth_check_token(const char *username, const char *given_token);