X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=common%2Fauth.h;h=651813f6c0e3a74577b64ba867808d628cf10b0b;hb=0595c4ad4f349efc7d907b5bc4ad774c231f2588;hp=da024c9c1e0e7308815c334d042e9b2b45bd3cc2;hpb=3d27274b36b44816c736ea8a411341b5a36556f9;p=blerg.git diff --git a/common/auth.h b/common/auth.h index da024c9..651813f 100644 --- a/common/auth.h +++ b/common/auth.h @@ -1,8 +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 +#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 *); +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