From 09d65829ae970930c6942a6c06058e584f24b770 Mon Sep 17 00:00:00 2001 From: dartraiden Date: Wed, 5 Jan 2022 22:24:16 +0300 Subject: libcurl: update to 7.81.0 --- libs/libcurl/src/vssh/libssh2.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libs/libcurl/src/vssh') diff --git a/libs/libcurl/src/vssh/libssh2.c b/libs/libcurl/src/vssh/libssh2.c index 7466840ffa..581bc1be82 100644 --- a/libs/libcurl/src/vssh/libssh2.c +++ b/libs/libcurl/src/vssh/libssh2.c @@ -645,8 +645,8 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) hostkey = libssh2_session_hostkey(sshc->ssh_session, &len, NULL); if(hostkey) { - Curl_sha256it(hash, (const unsigned char *) hostkey, len); - fingerprint = (char *) hash; + if(!Curl_sha256it(hash, (const unsigned char *) hostkey, len)) + fingerprint = (char *) hash; } #endif @@ -661,16 +661,15 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) /* The length of fingerprint is 32 bytes for SHA256. * See libssh2_hostkey_hash documentation. */ - if(Curl_base64_encode (data, fingerprint, 32, &fingerprint_b64, - &fingerprint_b64_len) != CURLE_OK) { + if(Curl_base64_encode(data, fingerprint, 32, &fingerprint_b64, + &fingerprint_b64_len) != CURLE_OK) { state(data, SSH_SESSION_FREE); sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; return sshc->actualcode; } if(!fingerprint_b64) { - failf(data, - "sha256 fingerprint could not be encoded"); + failf(data, "sha256 fingerprint could not be encoded"); state(data, SSH_SESSION_FREE); sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; return sshc->actualcode; @@ -698,7 +697,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) failf(data, "Denied establishing ssh session: mismatch sha256 fingerprint. " - "Remote %s is not equal to %s", fingerprint, pubkey_sha256); + "Remote %s is not equal to %s", fingerprint_b64, pubkey_sha256); state(data, SSH_SESSION_FREE); sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; return sshc->actualcode; -- cgit v1.2.3