Skip to content
Snippets Groups Projects
Commit a5ee3398 authored by Matt Johnston's avatar Matt Johnston
Browse files

Make bad known_hosts lines a warning

Instead of exiting
parent bb2379d6
Branches
No related merge requests found
......@@ -97,9 +97,13 @@ pub fn check_known_hosts_file(
continue;
}
let known_key = OpenSSHKey::from_openssh(&lk).map_err(|_| {
KnownHostsError::Other { msg: format!("Bad key format {}:{}", p.display(), line) }
})?;
let known_key = match OpenSSHKey::from_openssh(&lk) {
Ok(k) => k,
Err(e) => {
warn!("Unparsed key for {} on line {}:{}", host, p.display(), line);
continue;
}
};
if pubk.algorithm() != known_key.algorithm() {
debug!("Line {line}, Ignoring other-format existing key {known_key:?}")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment