diff --git a/src/box/auth_chap_sha1.c b/src/box/auth_chap_sha1.c index af2b1534e3dc3293d0426701c8231bc4b174589e..113f7016fcec7b5075b87d2048247206c456a3f4 100644 --- a/src/box/auth_chap_sha1.c +++ b/src/box/auth_chap_sha1.c @@ -250,10 +250,12 @@ auth_chap_sha1_authenticator_delete(struct authenticator *auth_) /** auth_method::authenticator_check_request */ static bool auth_chap_sha1_authenticate_request(const struct authenticator *auth_, + const char *user, const char *salt, const char *auth_request, const char *auth_request_end) { + (void)user; const struct auth_chap_sha1_authenticator *auth = (const struct auth_chap_sha1_authenticator *)auth_; uint32_t scramble_len; diff --git a/src/box/auth_md5.c b/src/box/auth_md5.c index 17ce39087ccb323cd098b0088d00b416a6cf4f53..b373ba1eb04c2d890143f6ed1b875104fff3eec1 100644 --- a/src/box/auth_md5.c +++ b/src/box/auth_md5.c @@ -205,10 +205,12 @@ auth_md5_authenticator_delete(struct authenticator *auth_) /** auth_method::authenticator_check_request */ static bool auth_md5_authenticate_request(const struct authenticator *auth_, + const char *user, const char *salt, const char *auth_request, const char *auth_request_end) { + (void)user; const struct auth_md5_authenticator *auth = (const struct auth_md5_authenticator *)auth_; uint32_t client_pass_len; diff --git a/src/box/authentication.c b/src/box/authentication.c index 602e59d2934eb1a039f3d0e7f749e60d066d0b7b..9e2f0206756a9ee7ce45b8e9f9b280d74392a551 100644 --- a/src/box/authentication.c +++ b/src/box/authentication.c @@ -49,7 +49,7 @@ authenticate_password(const struct authenticator *auth, const char *auth_request, *auth_request_end; auth_request_prepare(auth->method, password, password_len, user, salt, &auth_request, &auth_request_end); - bool ret = authenticate_request(auth, salt, auth_request, + bool ret = authenticate_request(auth, user, salt, auth_request, auth_request_end); region_truncate(region, region_svp); return ret; @@ -109,7 +109,7 @@ authenticate(const char *user_name, uint32_t user_name_len, return -1; if (user == NULL || user->def->auth == NULL || user->def->auth->method != method || - !authenticate_request(user->def->auth, salt, + !authenticate_request(user->def->auth, user->def->name, salt, auth_request, auth_request_end)) { auth_res.is_authenticated = false; if (session_run_on_auth_triggers(&auth_res) != 0) diff --git a/src/box/authentication.h b/src/box/authentication.h index 1c1b932bf82d39846450a8dba922e9e8b265727c..35fd4cfe212a7943d86454ec59d23a0e560897b5 100644 --- a/src/box/authentication.h +++ b/src/box/authentication.h @@ -138,6 +138,7 @@ struct auth_method { */ bool (*authenticate_request)(const struct authenticator *auth, + const char *user, const char *salt, const char *auth_request, const char *auth_request_end); @@ -191,13 +192,15 @@ authenticator_delete(struct authenticator *auth) * NOTE: the request must be well-formed (checked by auth_request_check). */ static inline bool -authenticate_request(const struct authenticator *auth, const char *salt, +authenticate_request(const struct authenticator *auth, + const char *user, const char *salt, const char *auth_request, const char *auth_request_end) { assert(auth->method->auth_request_check(auth->method, auth_request, auth_request_end) == 0); - return auth->method->authenticate_request( - auth, salt, auth_request, auth_request_end); + return auth->method->authenticate_request(auth, user, salt, + auth_request, + auth_request_end); } /**