MXS-2891: Log password hash on mismatch

By logging the password hash when user authentication fails due to a
password mismatch, we can be certain what the client sent and what is the
currently stored value in MaxScale. This should not be on by default which
is why a new parameter is required.
This commit is contained in:
Markus Mäkelä
2020-03-04 11:46:54 +02:00
parent 0aae500577
commit 1bf46fadf6
4 changed files with 53 additions and 12 deletions

View File

@ -112,6 +112,7 @@ typedef struct mysql_auth
bool skip_auth; /**< Authentication will always be successful */
bool check_permissions;
bool lower_case_table_names; /**< Disable database case-sensitivity */
bool log_password_mismatch; /**< Log password mismatches*/
uint64_t checksum;
} MYSQL_AUTH;
@ -212,4 +213,7 @@ int validate_mysql_user(MYSQL_AUTH* instance,
uint8_t* scramble,
size_t scramble_len);
std::pair<bool, std::string> get_password(MYSQL_AUTH* instance, DCB* dcb, MYSQL_session* session,
uint8_t* scramble, size_t scramble_len);
MXS_END_DECLS