libssh: add support for SHA256 host public keys

Reported-by: Joshua Rogers
Fixes #21605

Closes #21607
This commit is contained in:
Viktor Szakats 2026-05-14 13:32:46 +02:00
parent 9135294115
commit eb9b253d66
No known key found for this signature in database
11 changed files with 85 additions and 48 deletions

View file

@ -2768,10 +2768,7 @@ static ParameterError opt_string(struct OperationConfig *config,
}
break;
case C_HOSTPUBSHA256: /* --hostpubsha256 */
if(!feature_libssh2)
err = PARAM_LIBCURL_DOESNT_SUPPORT;
else
err = getstr(&config->hostpubsha256, nextarg, DENY_BLANK);
err = getstr(&config->hostpubsha256, nextarg, DENY_BLANK);
break;
case C_TLSUSER: /* --tlsuser */
if(!feature_tls_srp)

View file

@ -71,7 +71,6 @@ bool feature_http2 = FALSE;
bool feature_http3 = FALSE;
bool feature_httpsproxy = FALSE;
bool feature_libz = FALSE;
bool feature_libssh2 = FALSE;
bool feature_ntlm = FALSE;
bool feature_ntlm_wb = FALSE;
bool feature_spnego = FALSE;
@ -183,9 +182,6 @@ CURLcode get_libcurl_info(void)
++feature_count;
}
feature_libssh2 = curlinfo->age >= CURLVERSION_FOURTH &&
curlinfo->libssh_version &&
!strncmp("libssh2", curlinfo->libssh_version, 7);
return CURLE_OK;
}

View file

@ -54,7 +54,6 @@ extern bool feature_http2;
extern bool feature_http3;
extern bool feature_httpsproxy;
extern bool feature_libz;
extern bool feature_libssh2;
extern bool feature_ntlm;
extern bool feature_ntlm_wb;
extern bool feature_spnego;