Commit dbb6429c60fb3c266197ab22633fda88b0e7ea29

Patrick Steinhardt 2020-01-10T14:30:18

Merge pull request #5305 from kas-luthor/bugfix/multiple-auth Adds support for multiple SSH auth mechanisms being used sequentially

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index ecf55db..18d90a9 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -646,6 +646,14 @@ post_extract:
 		}
 
 		error = _git_ssh_authenticate_session(session, cred);
+
+		if (error == GIT_EAUTH) {
+			/* refresh auth methods */
+			if ((error = list_auth_methods(&auth_methods, session, urldata.username)) < 0)
+				goto done;
+			else
+				error = GIT_EAUTH;
+		}
 	}
 
 	if (error < 0)