]> git.ipfire.org Git - thirdparty/curl.git/commit
libssh2: fix error message on failed pubkey-from-file
authorJay Satiro <raysatiro@yahoo.com>
Mon, 18 Sep 2023 21:58:23 +0000 (17:58 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 21 Sep 2023 06:59:21 +0000 (02:59 -0400)
commit80fc040e4523570d7a69e6bdad06c2380a596765
treeff48335c671a9e6a699ea545c6a78a27d6fab93f
parent3d53f211e5c907bb6e8aaddf05a3acdcae247e5d
libssh2: fix error message on failed pubkey-from-file

- If libssh2_userauth_publickey_fromfile_ex returns -1 then show error
  message "SSH public key authentication failed: Reason unknown (-1)".

When libssh2_userauth_publickey_fromfile_ex returns -1 it does so as a
generic error and therefore doesn't set an error message. AFAICT that is
not documented behavior.

Prior to this change libcurl retrieved the last set error message which
would be from a previous function failing. That resulted in misleading
auth failed error messages in verbose mode.

Bug: https://github.com/curl/curl/issues/11837#issue-1891827355
Reported-by: consulion@users.noreply.github.com
Closes https://github.com/curl/curl/pull/11881
lib/vssh/libssh2.c