mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Fix cosmetic keyboard-interactive issue: at the end of a normal k-i session,
some servers (Debian in particular seems prone to this) send a k-i packet with
no prompts and nothing to display. We were printing an extra "Using
keyboard-interactive authentication" message in this case. (Introduced by me
in r8172, I think.)
[originally from svn r8492]
[r8172 == 211fdb9f46
]
This commit is contained in:
parent
d0661ca94e
commit
713df723ae
44
ssh.c
44
ssh.c
@ -8103,23 +8103,6 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
||||
ssh_pkt_getstring(pktin, &lang, &lang_len);
|
||||
s->cur_prompt = new_prompts(ssh->frontend);
|
||||
s->cur_prompt->to_server = TRUE;
|
||||
if (name_len) {
|
||||
/* FIXME: better prefix to distinguish from
|
||||
* local prompts? */
|
||||
s->cur_prompt->name =
|
||||
dupprintf("SSH server: %.*s", name_len, name);
|
||||
s->cur_prompt->name_reqd = TRUE;
|
||||
} else {
|
||||
s->cur_prompt->name =
|
||||
dupstr("SSH server authentication");
|
||||
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 =
|
||||
dupprintf("Using keyboard-interactive authentication.%s%.*s",
|
||||
inst_len ? "\n" : "", inst_len, inst);
|
||||
s->cur_prompt->instr_reqd = TRUE;
|
||||
|
||||
/*
|
||||
* Get any prompt(s) from the packet.
|
||||
@ -8143,6 +8126,33 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
|
||||
echo, SSH_MAX_PASSWORD_LEN);
|
||||
}
|
||||
|
||||
if (name_len) {
|
||||
/* FIXME: better prefix to distinguish from
|
||||
* local prompts? */
|
||||
s->cur_prompt->name =
|
||||
dupprintf("SSH server: %.*s", name_len, name);
|
||||
s->cur_prompt->name_reqd = TRUE;
|
||||
} else {
|
||||
s->cur_prompt->name =
|
||||
dupstr("SSH server authentication");
|
||||
s->cur_prompt->name_reqd = FALSE;
|
||||
}
|
||||
/* We add a prefix to try to make it clear that a prompt
|
||||
* has come from the server.
|
||||
* FIXME: ugly to print "Using..." in prompt _every_
|
||||
* time round. Can this be done more subtly? */
|
||||
/* Special case: for reasons best known to themselves,
|
||||
* some servers send k-i requests with no prompts and
|
||||
* nothing to display. Keep quiet in this case. */
|
||||
if (s->num_prompts || name_len || inst_len) {
|
||||
s->cur_prompt->instruction =
|
||||
dupprintf("Using keyboard-interactive authentication.%s%.*s",
|
||||
inst_len ? "\n" : "", inst_len, inst);
|
||||
s->cur_prompt->instr_reqd = TRUE;
|
||||
} else {
|
||||
s->cur_prompt->instr_reqd = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display any instructions, and get the user's
|
||||
* response(s).
|
||||
|
Loading…
Reference in New Issue
Block a user