mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-15 08:55:06 +01:00
clippy
This commit is contained in:
parent
7cc5a75fe2
commit
b3081cfeb9
5 changed files with 9 additions and 9 deletions
|
|
@ -89,13 +89,13 @@ impl ClientConnection {
|
|||
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..]);
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ pub struct AlgorithmNegotiation<T> {
|
|||
}
|
||||
|
||||
impl<T: AlgorithmName> AlgorithmNegotiation<T> {
|
||||
pub fn find<'a>(mut self, peer_supports: &str) -> Result<T> {
|
||||
pub fn find(mut self, peer_supports: &str) -> Result<T> {
|
||||
for client_alg in peer_supports.split(',') {
|
||||
if let Some(alg) = self
|
||||
.supported
|
||||
|
|
@ -455,7 +455,7 @@ fn derive_key(
|
|||
|
||||
for i in 0..(padded_key_size / sha2len) {
|
||||
let mut hash = <sha2::Sha256 as sha2::Digest>::new();
|
||||
encode_mpint_for_hash(&k, |data| hash.update(data));
|
||||
encode_mpint_for_hash(k, |data| hash.update(data));
|
||||
hash.update(h);
|
||||
|
||||
if i == 0 {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ pub fn packet_type_to_string(packet_type: u8) -> &'static str {
|
|||
98 => "SSH_MSG_CHANNEL_REQUEST",
|
||||
99 => "SSH_MSG_CHANNEL_SUCCESS",
|
||||
100 => "SSH_MSG_CHANNEL_FAILURE",
|
||||
_ => return "<unknown>",
|
||||
_ => "<unknown>",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue