From: Joel Depooter Date: Fri, 20 Jun 2025 22:44:02 +0000 (-0700) Subject: libssh: fix incorrect return value in myssh_in_AUTH_PKEY_INIT X-Git-Tag: rc-8_15_0-1~3 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3d9675924325bda60ff44510ada012d47962cde;p=thirdparty%2Fcurl.git libssh: fix incorrect return value in myssh_in_AUTH_PKEY_INIT In the unlikely case that no SSH auth methods are supported, the previous code would return 0 from myssh_in_AUTH_PKEY_INIT. However, following the code path, it seems like it should be returning SSH_ERROR, as set in myssh_to_ERROR (through myssh_to_GSSAPI_AUTH, myssh_to_KEY_AUTH and myssh_to_PASSWD_AUTH). In actuality, this is unlikely to occur, as the similar code in myssh_in_AUTHLIST would have already returned an error in this scenario. However setting a return value and then ignoring it is a bit fishy and should be documented if this is intended. I believe this used to return an error, but was changed in the recent re-factoring of this code. Closes #17691 --- diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 6f9be1b785..84ef9e1ca9 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -960,7 +960,7 @@ static int myssh_in_AUTH_PKEY_INIT(struct Curl_easy *data, int rc; if(!(data->set.ssh_auth_types & CURLSSH_AUTH_PUBLICKEY)) { rc = myssh_to_GSSAPI_AUTH(data, sshc); - return 0; + return rc; } /* Two choices, (1) private key was given on CMD,