Skip to content

Commit

Permalink
mysql: infer empty password to mean no password
Browse files Browse the repository at this point in the history
  • Loading branch information
mehcode committed Mar 31, 2020
1 parent d3eb9c7 commit d820763
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sqlx-core/src/mysql/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit d820763

Please sign in to comment.