mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:33:32 +03:00
libssh2: add CURLOPT_SSH_HOSTKEYFUNCTION
The callback set by CURLOPT_SSH_HOSTKEYFUNCTION is called to check wether or not the connection should continue. The host key is passed in argument with a custom handle for the application. It overrides CURLOPT_SSH_KNOWNHOSTS Closes #7959
This commit is contained in:
parent
267d560b5a
commit
1544513958
11 changed files with 263 additions and 20 deletions
12
lib/setopt.c
12
lib/setopt.c
|
|
@ -2466,7 +2466,19 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
result = Curl_setstropt(&data->set.str[STRING_SSH_KNOWNHOSTS],
|
||||
va_arg(param, char *));
|
||||
break;
|
||||
#ifdef USE_LIBSSH2
|
||||
case CURLOPT_SSH_HOSTKEYFUNCTION:
|
||||
/* the callback to check the hostkey without the knownhost file */
|
||||
data->set.ssh_hostkeyfunc = va_arg(param, curl_sshhostkeycallback);
|
||||
break;
|
||||
|
||||
case CURLOPT_SSH_HOSTKEYDATA:
|
||||
/*
|
||||
* Custom client data to pass to the SSH keyfunc callback
|
||||
*/
|
||||
data->set.ssh_hostkeyfunc_userp = va_arg(param, void *);
|
||||
break;
|
||||
#endif
|
||||
case CURLOPT_SSH_KEYFUNCTION:
|
||||
/* setting to NULL is fine since the ssh.c functions themselves will
|
||||
then revert to use the internal default */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue