libssh: map SSH_KNOWN_HOSTS_OTHER to CURLKHMATCH_MISMATCH

Host key type mismatch from libssh was incorrectly reported as missing,
causing key callbacks to accept instead of reject.

Reported by: Joshua Rogers (Aisle Research)
Closes #21724
This commit is contained in:
Joshua Rogers 2026-05-22 09:48:15 +02:00 committed by Daniel Stenberg
parent 4102400028
commit 0b8dbbc63c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -277,6 +277,8 @@ static int myssh_is_known(struct Curl_easy *data, struct ssh_conn *sshc)
keymatch = CURLKHMATCH_OK;
break;
case SSH_KNOWN_HOSTS_OTHER:
keymatch = CURLKHMATCH_MISMATCH;
break;
case SSH_KNOWN_HOSTS_NOT_FOUND:
case SSH_KNOWN_HOSTS_UNKNOWN:
case SSH_KNOWN_HOSTS_ERROR: