X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=common%2Fauth.h;h=630b87a834d2e9667732185471f19c0e1bd24ef8;hb=HEAD;hp=9d3fe499d036cc69560f7ca052bfa281d131bfaf;hpb=65363bdbdec43b2efd906d8fa848fc4d69c529d2;p=blerg.git diff --git a/common/auth.h b/common/auth.h index 9d3fe49..630b87a 100644 --- a/common/auth.h +++ b/common/auth.h @@ -14,13 +14,23 @@ #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, 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); +int auth_get_counter(const char *username, uint32_t *counter); #endif //_AUTH_H