tool_getparam: fail --hostpubsha256 if libssh2 is not used
Reported-by: Harry Sintonen Closes #16109
This commit is contained in:
parent
1b740aedcd
commit
58c22dda66
@ -2406,7 +2406,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||
}
|
||||
break;
|
||||
case C_HOSTPUBSHA256: /* --hostpubsha256 */
|
||||
err = getstr(&config->hostpubsha256, nextarg, DENY_BLANK);
|
||||
if(!feature_libssh2)
|
||||
err = PARAM_LIBCURL_DOESNT_SUPPORT;
|
||||
else
|
||||
err = getstr(&config->hostpubsha256, nextarg, DENY_BLANK);
|
||||
break;
|
||||
case C_CRLFILE: /* --crlfile */
|
||||
err = getstr(&config->crlfile, nextarg, DENY_BLANK);
|
||||
|
||||
@ -77,6 +77,7 @@ 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;
|
||||
@ -190,6 +191,8 @@ CURLcode get_libcurl_info(void)
|
||||
++feature_count;
|
||||
}
|
||||
|
||||
feature_libssh2 = curlinfo->libssh_version &&
|
||||
!strncmp("libssh2", curlinfo->libssh_version, 7);
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -55,6 +55,7 @@ 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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user