Implement Trust Authentication

This commit is contained in:
Andrew Jackson
2024-09-05 09:40:03 -05:00
committed by CommanderKeynes
parent 9bb71ede9d
commit feedcd49d9
9 changed files with 328 additions and 137 deletions

View File

@@ -64,6 +64,20 @@ where
write_all(stream, auth_ok).await
}
/// Tell the client to use clearr text auth
pub async fn clear_text_challenge<S>(stream: &mut S) -> Result<(), Error>
where
S: tokio::io::AsyncWrite + std::marker::Unpin,
{
let mut auth_clear_text = BytesMut::with_capacity(9);
auth_clear_text.put_u8(b'R');
auth_clear_text.put_i32(8);
auth_clear_text.put_i32(3);
write_all(stream, auth_clear_text).await
}
/// Generate md5 password challenge.
pub async fn md5_challenge<S>(stream: &mut S) -> Result<[u8; 4], Error>
where