Skip to content
Snippets Groups Projects
Commit 918d4825 authored by Matt Johnston's avatar Matt Johnston
Browse files

Make client exit if no auth methods are left

parent a5ee3398
No related merge requests found
...@@ -285,18 +285,18 @@ impl CliAuth { ...@@ -285,18 +285,18 @@ impl CliAuth {
let req = self.make_password_req(b).await?; let req = self.make_password_req(b).await?;
if let Some(req) = req { if let Some(req) = req {
self.state = AuthState::Request { last_req: req, sig: None }; self.state = AuthState::Request { last_req: req, sig: None };
} else {
self.try_password = false;
} }
} }
if !(self.try_pubkey || self.try_password) {
return Err(Error::BehaviourError {
msg: "No authentication methods left",
});
}
if let AuthState::Request { last_req, .. } = &self.state { if let AuthState::Request { last_req, .. } = &self.state {
let p = last_req.req_packet(&self.username, parse_ctx)?; let p = last_req.req_packet(&self.username, parse_ctx)?;
s.send(p)?; s.send(p)?;
} else {
return Err(Error::BehaviourError {
msg: "No authentication methods left",
});
} }
Ok(()) Ok(())
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment