Commit 781d73bfb0cbc218c7f82b78a9fce51f29719535

Edward Thomson 2017-10-28T12:08:39

Merge pull request #4357 from invenia/cv/ssh-passphrase-incorrect Ask for SSH credentials again when passphrase is wrong

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 47d328c..b372992 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -419,8 +419,10 @@ static int _git_ssh_authenticate_session(
 		}
 	} while (LIBSSH2_ERROR_EAGAIN == rc || LIBSSH2_ERROR_TIMEOUT == rc);
 
-        if (rc == LIBSSH2_ERROR_PASSWORD_EXPIRED || rc == LIBSSH2_ERROR_AUTHENTICATION_FAILED)
-                return GIT_EAUTH;
+	if (rc == LIBSSH2_ERROR_PASSWORD_EXPIRED ||
+		rc == LIBSSH2_ERROR_AUTHENTICATION_FAILED ||
+		rc == LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED)
+			return GIT_EAUTH;
 
 	if (rc != LIBSSH2_ERROR_NONE) {
 		if (!giterr_last())