Closed
Description
Hi,
Please correct me if I'm wrong, but it looks like SSHJ does not handle the case of the OpenSSH known_hosts file having multiple entries for the same server. This can end up in practice due to new keys (or even due to servers behind a load balancer perhaps).
The following code in OpenSSHKnownHosts:verify
seems to be doing the verification:
try {
if (e.appliesTo(type, adjustedHostname))
return e.verify(key) || hostKeyChangedAction(e, adjustedHostname, key);
} catch (IOException ioe) {
log.error("Error with {}: {}", e, ioe);
return false;
}
However, openssh itself seems to handle this by trying all keys that match the server, and validates if any of them match.
Am I missing something here? If the above diagnosis is correct, I'd be happy to submit a PR :)
Metadata
Metadata
Assignees
Labels
No labels