X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=common%2Fauth.h;h=651813f6c0e3a74577b64ba867808d628cf10b0b;hb=4d670f36be4aa9843fd429f545fe340cbb2e4d7f;hp=d180bfde8d4d72ee5a579e8d07a133da906ba100;hpb=54789cc8538714fc3622646721f6f2ecceae94ac;p=blerg.git diff --git a/common/auth.h b/common/auth.h index d180bfd..651813f 100644 --- a/common/auth.h +++ b/common/auth.h @@ -4,12 +4,21 @@ #ifndef _AUTH_H #define _AUTH_H +#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 *, const char *); +int auth_get_password_version(const char *); int auth_get_password(const char *, char *); +int auth_get_salt(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); +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