Skip to content

Commit

Permalink
fixed warp-tech/warpgate#996 - prevent offering unparsable keys from …
Browse files Browse the repository at this point in the history
…ending the session
  • Loading branch information
Eugeny committed Jul 18, 2024
1 parent 9c2265e commit f2d94c0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions russh/src/server/encrypted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,11 @@ impl Encrypted {
Ok(())
}
}
Err(e) => {
if let russh_keys::Error::CouldNotReadKey = e {
reject_auth_request(until, &mut self.write, auth_request).await;
Ok(())
} else {
Err(crate::Error::from(e).into())
}
Err(russh_keys::Error::CouldNotReadKey) | Err(russh_keys::Error::KeyIsCorrupt) => {
reject_auth_request(until, &mut self.write, auth_request).await;
Ok(())
}
Err(e) => Err(crate::Error::from(e).into()),
}
}
}
Expand Down

0 comments on commit f2d94c0

Please sign in to comment.