diff options
author | kas <kas-luthor@users.noreply.github.com> | 2019-11-16 22:41:25 +0100 |
---|---|---|
committer | kas <kas-luthor@users.noreply.github.com> | 2019-11-16 22:41:25 +0100 |
commit | fbdf5bdd9f530ed163667be108107864c16b00ea (patch) | |
tree | b30d921553159363612e714eff1726df8ffd387c /src | |
parent | 01ea911b9e14a38f94a0018c13e5f308719aced6 (diff) | |
download | libgit2-fbdf5bdd9f530ed163667be108107864c16b00ea.tar.gz |
Adds support for multiple SSH auth mechanisms being used sequentially
Diffstat (limited to 'src')
-rw-r--r-- | src/transports/ssh.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/transports/ssh.c b/src/transports/ssh.c index 21594181b..0c492ca54 100644 --- a/src/transports/ssh.c +++ b/src/transports/ssh.c @@ -518,6 +518,7 @@ static int _git_ssh_setup_conn( { git_net_url urldata = GIT_NET_URL_INIT; int auth_methods, error = 0; + int sub_error; size_t i; ssh_stream *s; git_cred *cred = NULL; @@ -638,6 +639,15 @@ post_extract: } error = _git_ssh_authenticate_session(session, cred); + + if (error == GIT_EAUTH) { + /* refresh auth methods */ + sub_error = list_auth_methods(&auth_methods, session, urldata.username); + if (sub_error < 0) { + error = sub_error; + goto done; + } + } } if (error < 0) |