mysql: infer empty password to mean no password

This commit is contained in:
Ryan Leckey 2020-03-30 18:42:25 -07:00
parent d3eb9c7800
commit d820763bb9

View File

@ -134,6 +134,11 @@ async fn make_auth_response(
password: &str,
nonce: &[u8],
) -> crate::Result<Vec<u8>> {
if password.is_empty() {
// Empty password should not be sent
return Ok(vec![]);
}
match plugin {
AuthPlugin::CachingSha2Password | AuthPlugin::MySqlNativePassword => {
Ok(plugin.scramble(password, nonce))