From d71e3b25321fa07349c9f1fbfc1b209449d7c3dd Mon Sep 17 00:00:00 2001 From: Marius Ungureanu Date: Tue, 2 Jun 2015 10:23:54 +0300 Subject: [PATCH] Change error when running out of ssh agent keys --- src/transports/ssh.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/transports/ssh.c b/src/transports/ssh.c index 58f1aeb64..5c8545fe1 100644 --- a/src/transports/ssh.c +++ b/src/transports/ssh.c @@ -293,8 +293,14 @@ static int ssh_agent_auth(LIBSSH2_SESSION *session, git_cred_ssh_key *c) { if (rc < 0) goto shutdown; - if (rc == 1) + /* rc is set to 1 whenever the ssh agent ran out of keys to check. + * Set the error code to authentication failure rather than erroring + * out with an untranslatable error code. + */ + if (rc == 1) { + rc = LIBSSH2_ERROR_AUTHENTICATION_FAILED; goto shutdown; + } rc = libssh2_agent_userauth(agent, c->username, curr);