Skip to content

Commit

Permalink
server/encrypted.rs: respect proceed_with_methods in "none" and "pa…
Browse files Browse the repository at this point in the history
…ssword" authentication methods
  • Loading branch information
samuela authored and Eugeny committed Feb 3, 2024
1 parent 2ce133d commit 44a2392
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions russh/src/server/encrypted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,14 @@ impl Encrypted {
self.state = EncryptedState::InitCompression;
} else {
auth_user.clear();
auth_request.methods -= MethodSet::PASSWORD;
if let Auth::Reject {
proceed_with_methods: Some(proceed_with_methods),
} = auth
{
auth_request.methods = proceed_with_methods;
} else {
auth_request.methods -= MethodSet::PASSWORD;
}
auth_request.partial_success = false;
reject_auth_request(until, &mut self.write, auth_request).await;
}
Expand All @@ -326,7 +333,14 @@ impl Encrypted {
self.state = EncryptedState::InitCompression;
} else {
auth_user.clear();
auth_request.methods -= MethodSet::NONE;
if let Auth::Reject {
proceed_with_methods: Some(proceed_with_methods),
} = auth
{
auth_request.methods = proceed_with_methods;
} else {
auth_request.methods -= MethodSet::NONE;
}
auth_request.partial_success = false;
reject_auth_request(until, &mut self.write, auth_request).await;
}
Expand Down

0 comments on commit 44a2392

Please sign in to comment.