This commit is contained in:
nora 2024-08-15 22:16:10 +02:00
parent 7cc5a75fe2
commit b3081cfeb9
5 changed files with 9 additions and 9 deletions

View file

@ -78,13 +78,13 @@ impl ServerConnection {
self.packet_transport.recv_bytes(bytes)?;
while let Some(packet) = self.packet_transport.recv_next_packet() {
let packet_type = packet.payload.get(0).unwrap_or(&0xFF);
let packet_type = packet.payload.first().unwrap_or(&0xFF);
let packet_type_string = numbers::packet_type_to_string(*packet_type);
trace!(%packet_type, %packet_type_string, packet_len = %packet.payload.len(), "Received packet");
// Handle some packets ignoring the state.
match packet.payload.get(0).copied() {
match packet.payload.first().copied() {
Some(numbers::SSH_MSG_DISCONNECT) => {
// <https://datatracker.ietf.org/doc/html/rfc4253#section-11.1>
let mut disconnect = Parser::new(&packet.payload[1..]);
@ -217,7 +217,7 @@ impl ServerConnection {
let pub_hostkey = server_host_key_algorithm.public_key();
let hash = crypto::key_exchange_hash(
&client_identification,
client_identification,
SERVER_IDENTIFICATION,
client_kexinit,
server_kexinit,