MXS-2883: Handle AuthSwitchRequest packets
The backend didn't expect AuthSwitchRequest packets in response to the handshake response packets. This is allowed by the protocol and appears to happen with at least MySQL 8.0.
This commit is contained in:
@ -92,6 +92,11 @@ static bool auth_backend_extract(DCB* dcb, GWBUF* buf)
|
||||
rval = true;
|
||||
mba->state = MBA_AUTH_OK;
|
||||
}
|
||||
else if (mxs_mysql_get_command(buf) == MYSQL_REPLY_AUTHSWITCHREQUEST
|
||||
&& send_mysql_native_password_response(dcb, buf))
|
||||
{
|
||||
rval = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mba->state = MBA_AUTH_FAILED;
|
||||
@ -124,6 +129,11 @@ static int auth_backend_authenticate(DCB* dcb)
|
||||
/** Authentication completed successfully */
|
||||
rval = MXS_AUTH_SUCCEEDED;
|
||||
}
|
||||
else if (mba->state == MBA_NEED_OK)
|
||||
{
|
||||
/** Sent AuthSwitchRequest response */
|
||||
rval = MXS_AUTH_INCOMPLETE;
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
Reference in New Issue
Block a user