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:
Markus Mäkelä
2020-02-10 12:09:05 +02:00
parent ef769573e4
commit c18f9c6bd7
4 changed files with 30 additions and 22 deletions

View File

@ -784,14 +784,7 @@ static bool handle_auth_change_response(GWBUF* reply, MySQLProtocol* proto, DCB*
* a new scramble for the re-authentication process.
*/
// Load the new scramble into the protocol...
gwbuf_copy_data(reply,
5 + strlen(DEFAULT_MYSQL_AUTH_PLUGIN) + 1,
GW_MYSQL_SCRAMBLE_SIZE,
proto->scramble);
/// ... and use it to send the encrypted password to the server
rval = send_mysql_native_password_response(dcb);
rval = send_mysql_native_password_response(dcb, reply);
}
return rval;