Support sending passwords in cleartext

This commit is contained in:
Ryan Leckey 2019-06-10 22:07:47 -07:00
parent fda6d9ef81
commit 3bb8c17c57
2 changed files with 5 additions and 0 deletions

View file

@ -78,6 +78,10 @@ impl Connection {
// there is no password needed
}
ServerMessage::AuthenticationCleartextPassword => {
conn.send(PasswordMessage { password: options.password.unwrap_or_default() }).await?;
}
ServerMessage::AuthenticationMd5Password(body) => {
// Hash password|username
// FIXME: ConnectOptions should prepare a default user

View file

@ -76,6 +76,7 @@ impl Message {
b'R' => match BigEndian::read_i32(&buf[idx..]) {
0 => Message::AuthenticationOk,
3 => Message::AuthenticationCleartextPassword,
5 => Message::AuthenticationMd5Password(AuthenticationMd5Password {
salt: buf.slice_from(idx + 4),
}),