← Commit list

064cdf53d9

Andreas Westin
Andreas Westin
2026-09-24
SUCCESS Duration: 438s

Subject

libssh: work with empty priv_key

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/vssh/libssh.c+3 -2
@@ -834,7 +834,8 @@ static int myssh_in_AUTHLIST(struct Curl_easy *data,
/* For public key auth we need either the private key or
CURLSSH_AUTH_AGENT. */
if((sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY) &&
- (sshc->priv_key || (data->set.ssh_auth_types & CURLSSH_AUTH_AGENT))) {
+ ((sshc->priv_key && sshc->priv_key[0]) ||
+ (data->set.ssh_auth_types & CURLSSH_AUTH_AGENT))) {
myssh_to(data, sshc, SSH_AUTH_PKEY_INIT);
infof(data, "Authentication using SSH public key file");
}
@@ -864,7 +865,7 @@ static int myssh_in_AUTH_PKEY_INIT(struct Curl_easy *data,
/* Two choices, (1) private key was given on CMD,
* (2) use the "default" keys. */
- if(sshc->priv_key) {
+ if(sshc->priv_key && sshc->priv_key[0]) {
if(sshc->pubkey && !sshc->passphrase) {
rc = ssh_userauth_try_publickey(sshc->ssh_session, NULL, sshc->pubkey);
if(rc == SSH_AUTH_AGAIN)