This commit is contained in:
nora 2024-08-21 20:09:01 +02:00
parent afbda574f3
commit 9b49e09983
6 changed files with 339 additions and 1 deletions

View file

@ -19,6 +19,8 @@ pub struct ClientConnection {
rng: Box<dyn SshRng + Send + Sync>,
plaintext_packets: VecDeque<Packet>,
pub abort_for_dos: bool,
}
enum ClientState {
@ -67,6 +69,7 @@ impl ClientConnection {
rng: Box::new(rng),
plaintext_packets: VecDeque::new(),
abort_for_dos: false,
}
}
@ -215,6 +218,10 @@ impl ClientConnection {
));
}
if self.abort_for_dos {
return Err(peer_error!("early abort"));
}
let server_hostkey = dh.string()?;
let server_ephermal_key = dh.string()?;
let signature = dh.string()?;