mirror of
https://github.com/curl/curl.git
synced 2026-08-26 07:13:32 +03:00
libssh: require private key or user-agent for public key auth
Closes #20110
This commit is contained in:
parent
bc9ab557df
commit
16d5f2a566
1 changed files with 5 additions and 1 deletions
|
|
@ -921,7 +921,11 @@ static int myssh_in_AUTHLIST(struct Curl_easy *data,
|
|||
"keyboard-interactive, " : "",
|
||||
sshc->auth_methods & SSH_AUTH_METHOD_PASSWORD ?
|
||||
"password": "");
|
||||
if(sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {
|
||||
/* For public key auth we need either the private key or
|
||||
CURLSSH_AUTH_AGENT. */
|
||||
if((sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY) &&
|
||||
(data->set.str[STRING_SSH_PRIVATE_KEY] ||
|
||||
(data->set.ssh_auth_types & CURLSSH_AUTH_AGENT))) {
|
||||
myssh_to(data, sshc, SSH_AUTH_PKEY_INIT);
|
||||
infof(data, "Authentication using SSH public key file");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue