Skip to content

Commit f587d13

Browse files
authored
Reject unsupported key types instead of failing (#352)
Currently russh doesn't support ED25519/ECDSA-SK keys, but OpenSSH will attempt to use them anyway. Key parse will then fail, killing the session. This should be treated as-if auth_publickey_offered rejects the key.
1 parent 451e74b commit f587d13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

russh/src/server/encrypted.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,9 @@ impl Encrypted {
519519
Ok(())
520520
}
521521
}
522-
Err(russh_keys::Error::CouldNotReadKey) | Err(russh_keys::Error::KeyIsCorrupt) => {
522+
Err(russh_keys::Error::CouldNotReadKey)
523+
| Err(russh_keys::Error::KeyIsCorrupt)
524+
| Err(russh_keys::Error::UnsupportedKeyType { .. }) => {
523525
reject_auth_request(until, &mut self.write, auth_request).await;
524526
Ok(())
525527
}

0 commit comments

Comments
 (0)