mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 09:12:24 +00:00
I broke the ability to cope with multiple consecutive k-i INFO_REQUESTS
in r6437. This ought to be better (but I can't test that case).
[originally from svn r6451]
[r6437 == 8719f92c14
]
This commit is contained in:
parent
29f1ae8a7e
commit
c4b2b493ff
39
ssh.c
39
ssh.c
@ -7153,9 +7153,6 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
|||||||
/*
|
/*
|
||||||
* Keyboard-interactive authentication.
|
* Keyboard-interactive authentication.
|
||||||
*/
|
*/
|
||||||
char *name, *inst, *lang;
|
|
||||||
int name_len, inst_len, lang_len;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
s->type = AUTH_TYPE_KEYBOARD_INTERACTIVE;
|
s->type = AUTH_TYPE_KEYBOARD_INTERACTIVE;
|
||||||
|
|
||||||
@ -7175,7 +7172,9 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
|||||||
crWaitUntilV(pktin);
|
crWaitUntilV(pktin);
|
||||||
if (pktin->type != SSH2_MSG_USERAUTH_INFO_REQUEST) {
|
if (pktin->type != SSH2_MSG_USERAUTH_INFO_REQUEST) {
|
||||||
/* Server is not willing to do keyboard-interactive
|
/* Server is not willing to do keyboard-interactive
|
||||||
* at all. Give up on it entirely. */
|
* at all (or, bizarrely but legally, accepts the
|
||||||
|
* user without actually issuing any prompts).
|
||||||
|
* Give up on it entirely. */
|
||||||
s->gotit = TRUE;
|
s->gotit = TRUE;
|
||||||
if (pktin->type == SSH2_MSG_USERAUTH_FAILURE)
|
if (pktin->type == SSH2_MSG_USERAUTH_FAILURE)
|
||||||
logevent("Keyboard-interactive authentication refused");
|
logevent("Keyboard-interactive authentication refused");
|
||||||
@ -7184,6 +7183,15 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Loop while the server continues to send INFO_REQUESTs.
|
||||||
|
*/
|
||||||
|
while (pktin->type == SSH2_MSG_USERAUTH_INFO_REQUEST) {
|
||||||
|
|
||||||
|
char *name, *inst, *lang;
|
||||||
|
int name_len, inst_len, lang_len;
|
||||||
|
int i;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We've got a fresh USERAUTH_INFO_REQUEST.
|
* We've got a fresh USERAUTH_INFO_REQUEST.
|
||||||
* Get the preamble and start building a prompt.
|
* Get the preamble and start building a prompt.
|
||||||
@ -7196,13 +7204,16 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
|||||||
if (name_len) {
|
if (name_len) {
|
||||||
/* FIXME: better prefix to distinguish from
|
/* FIXME: better prefix to distinguish from
|
||||||
* local prompts? */
|
* local prompts? */
|
||||||
s->cur_prompt->name = dupprintf("SSH server: %.*s",
|
s->cur_prompt->name =
|
||||||
name_len, name);
|
dupprintf("SSH server: %.*s", name_len, name);
|
||||||
s->cur_prompt->name_reqd = TRUE;
|
s->cur_prompt->name_reqd = TRUE;
|
||||||
} else {
|
} else {
|
||||||
s->cur_prompt->name = dupstr("SSH server authentication");
|
s->cur_prompt->name =
|
||||||
|
dupstr("SSH server authentication");
|
||||||
s->cur_prompt->name_reqd = FALSE;
|
s->cur_prompt->name_reqd = FALSE;
|
||||||
}
|
}
|
||||||
|
/* FIXME: ugly to print "Using..." in prompt _every_
|
||||||
|
* time round. Can this be done more subtly? */
|
||||||
s->cur_prompt->instruction =
|
s->cur_prompt->instruction =
|
||||||
dupprintf("Using keyboard-interactive authentication.%s%.*s",
|
dupprintf("Using keyboard-interactive authentication.%s%.*s",
|
||||||
inst_len ? "\n" : "", inst_len, inst);
|
inst_len ? "\n" : "", inst_len, inst);
|
||||||
@ -7267,7 +7278,19 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
|||||||
end_log_omission(ssh, s->pktout);
|
end_log_omission(ssh, s->pktout);
|
||||||
}
|
}
|
||||||
ssh2_pkt_send(ssh, s->pktout);
|
ssh2_pkt_send(ssh, s->pktout);
|
||||||
s->type = AUTH_TYPE_KEYBOARD_INTERACTIVE;
|
|
||||||
|
/*
|
||||||
|
* Get the next packet in case it's another
|
||||||
|
* INFO_REQUEST.
|
||||||
|
*/
|
||||||
|
crWaitUntilV(pktin);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We should have SUCCESS or FAILURE now.
|
||||||
|
*/
|
||||||
|
s->gotit = TRUE;
|
||||||
|
|
||||||
} else if (s->can_passwd) {
|
} else if (s->can_passwd) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user