Skip to content

Commit fbdf5bd

Browse files
committed
Adds support for multiple SSH auth mechanisms being used sequentially
1 parent 01ea911 commit fbdf5bd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/transports/ssh.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ static int _git_ssh_setup_conn(
518518
{
519519
git_net_url urldata = GIT_NET_URL_INIT;
520520
int auth_methods, error = 0;
521+
int sub_error;
521522
size_t i;
522523
ssh_stream *s;
523524
git_cred *cred = NULL;
@@ -638,6 +639,15 @@ static int _git_ssh_setup_conn(
638639
}
639640

640641
error = _git_ssh_authenticate_session(session, cred);
642+
643+
if (error == GIT_EAUTH) {
644+
/* refresh auth methods */
645+
sub_error = list_auth_methods(&auth_methods, session, urldata.username);
646+
if (sub_error < 0) {
647+
error = sub_error;
648+
goto done;
649+
}
650+
}
641651
}
642652

643653
if (error < 0)

0 commit comments

Comments
 (0)