X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=common%2Fauth.h;h=4a167764d0b4fcff34b6230696de7c42d0cc5074;hb=948ce5be6ef6bba36edfb544565ca22e316afb0a;hp=24fd2935fe5b8ef032ab5539249fc8f37b0f90cc;hpb=38c482a01320aafbfead43ee0aa3edeba8314d8e;p=blerg.git diff --git a/common/auth.h b/common/auth.h index 24fd293..4a16776 100644 --- a/common/auth.h +++ b/common/auth.h @@ -4,6 +4,8 @@ #ifndef _AUTH_H #define _AUTH_H +#include + #define TOKEN_SIZE 16 #define MAX_PASSWORD_LENGTH 64 #define SCRYPT_SALT_SIZE 8 @@ -12,10 +14,19 @@ #define SCRYPT_r 8 #define SCRYPT_p 1 +struct auth_header { + uint8_t version; + uint8_t reserved1; + uint16_t reserved2; +}; + +struct auth_v2 { + struct auth_header header; + uint8_t password[SCRYPT_OUTPUT_SIZE]; + uint8_t salt[SCRYPT_SALT_SIZE]; +}; + 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);