Update client SHA1 on reauthentication

When the client reauthenticates via COM_CHANGE_USER the new SHA1 needs to
be stored as the backend connections rely on it being up-to-date.

This commit fixes the regression of the mxs548_short_session_change_user
test.
This commit is contained in:
Markus Mäkelä 2018-05-13 22:27:17 +03:00
parent f29da6545b
commit 10806f8d8c
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -1513,7 +1513,6 @@ static bool reauthenticate_client(MXS_SESSION* session, GWBUF* packetbuf)
if (session->client_dcb->authfunc.reauthenticate)
{
MySQLProtocol* proto = (MySQLProtocol*)session->client_dcb->protocol;
uint8_t client_sha1[MYSQL_SCRAMBLE_LEN] = {};
uint8_t payload[gwbuf_length(packetbuf) - MYSQL_HEADER_LEN];
gwbuf_copy_data(packetbuf, MYSQL_HEADER_LEN, sizeof(payload), payload);
@ -1529,7 +1528,7 @@ static bool reauthenticate_client(MXS_SESSION* session, GWBUF* packetbuf)
int rc = session->client_dcb->authfunc.reauthenticate(session->client_dcb, data->user,
payload, sizeof(payload),
proto->scramble, sizeof(proto->scramble),
client_sha1, sizeof(client_sha1));
data->client_sha1, sizeof(data->client_sha1));
if (rc == MXS_AUTH_SUCCEEDED)
{