Skip to content

Commit f2d94c0

Browse files
committed
fixed warp-tech/warpgate#996 - prevent offering unparsable keys from ending the session
1 parent 9c2265e commit f2d94c0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

russh/src/server/encrypted.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,14 +519,11 @@ impl Encrypted {
519519
Ok(())
520520
}
521521
}
522-
Err(e) => {
523-
if let russh_keys::Error::CouldNotReadKey = e {
524-
reject_auth_request(until, &mut self.write, auth_request).await;
525-
Ok(())
526-
} else {
527-
Err(crate::Error::from(e).into())
528-
}
522+
Err(russh_keys::Error::CouldNotReadKey) | Err(russh_keys::Error::KeyIsCorrupt) => {
523+
reject_auth_request(until, &mut self.write, auth_request).await;
524+
Ok(())
529525
}
526+
Err(e) => Err(crate::Error::from(e).into()),
530527
}
531528
}
532529
}

0 commit comments

Comments
 (0)