]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh: map SSH_KNOWN_HOSTS_OTHER to CURLKHMATCH_MISMATCH
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Fri, 22 May 2026 07:48:15 +0000 (09:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 25 May 2026 14:46:22 +0000 (16:46 +0200)
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

lib/vssh/libssh.c

index 09084765bcf0da0e0f6c828fbc4a8dd453be8636..817a463a2cce450e11ff4e8083dd337abccaba22 100644 (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: