X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=common%2Fauth.h;h=24fd2935fe5b8ef032ab5539249fc8f37b0f90cc;hb=8cf18d84c5d5c49cfab0e181e9bb3c2777554da2;hp=124f014de78d8d1569159a3a50f1854b68f522f9;hpb=e2f51ade69169968d9d54d3b601527a51c66f6ba;p=blerg.git diff --git a/common/auth.h b/common/auth.h index 124f014..24fd293 100644 --- a/common/auth.h +++ b/common/auth.h @@ -1,12 +1,24 @@ +/* Blerg is (C) 2011 The Dominion of Awesome, and is distributed under a + * BSD-style license. Please see the COPYING file for details. + */ #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 *); -int auth_login(const char *username, const char *password); -int auth_logout(const char *username); -char *auth_get_token(const char *username); +#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, char *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); #endif //_AUTH_H