From: mickae1 Date: Mon, 5 Dec 2022 13:24:02 +0000 (+0100) Subject: libssh2: return error when ssh_hostkeyfunc returns error X-Git-Tag: curl-7_87_0~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8fe33a96616a8e715a79c2513904784c78cbfb74;p=thirdparty%2Fcurl.git libssh2: return error when ssh_hostkeyfunc returns error return CURLE_PEER_FAILED_VERIFICATION if verification with the callback return a result different than CURLKHMATCH_OK Closes #10034 --- diff --git a/.mailmap b/.mailmap index cda33ffae9..5c0c9df123 100644 --- a/.mailmap +++ b/.mailmap @@ -100,3 +100,4 @@ zhanghu on xiaomi Philip Heiduck <47042125+pheiduck@users.noreply.github.com> bsergean on github Stefan Eissing +Michael Musset diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index d23926dbc0..ce9229f8fa 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -791,10 +791,14 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) Curl_set_in_callback(data, false); if(rc!= CURLKHMATCH_OK) { state(data, SSH_SESSION_FREE); + sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; + return sshc->actualcode; } } else { state(data, SSH_SESSION_FREE); + sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; + return sshc->actualcode; } return CURLE_OK; }