support SCRAM-SHA-1

This commit is contained in:
lumi 2017-02-24 23:42:08 +01:00
commit ff7387a92a
6 changed files with 283 additions and 10 deletions

View file

@ -19,12 +19,12 @@ impl Plain {
impl SaslMechanism for Plain {
fn name() -> &'static str { "PLAIN" }
fn initial(&mut self) -> Vec<u8> {
fn initial(&mut self) -> Result<Vec<u8>, String> {
let mut auth = Vec::new();
auth.push(0);
auth.extend(self.name.bytes());
auth.push(0);
auth.extend(self.password.bytes());
auth
Ok(auth)
}
}