If we got a keyboard-interactive INFO_REQUEST with an "instruction" string but
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Tue, 9 Sep 2008 20:36:40 +0000 (20:36 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Tue, 9 Sep 2008 20:36:40 +0000 (20:36 +0000)
no actual prompts, we weren't displaying the former, which was wrong. We
should now (although I haven't found a server to test it against).

git-svn-id: svn://svn.tartarus.org/sgt/putty@8172 cda61777-01e9-0310-a592-d414129be87e

putty.h
ssh.c

diff --git a/putty.h b/putty.h
index a2f320c..8aea91c 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -686,7 +686,8 @@ typedef struct {
     int name_reqd;     /* Display of `name' required or optional? */
     char *instruction; /* Long description, maybe with embedded newlines */
     int instr_reqd;    /* Display of `instruction' required or optional? */
-    size_t n_prompts;
+    size_t n_prompts;   /* May be zero (in which case display the foregoing,
+                         * if any, and return success) */
     prompt_t **prompts;
     void *frontend;
     void *data;                /* slot for housekeeping data, managed by
diff --git a/ssh.c b/ssh.c
index 84a66e0..f2e1f51 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -8022,7 +8022,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
                    s->cur_prompt->instr_reqd = TRUE;
 
                    /*
-                    * Get the prompts from the packet.
+                    * Get any prompt(s) from the packet.
                     */
                    s->num_prompts = ssh_pkt_getuint32(pktin);
                    for (i = 0; i < s->num_prompts; i++) {
@@ -8044,9 +8044,10 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
                    }
 
                    /*
-                    * Get the user's responses.
+                     * Display any instructions, and get the user's
+                     * response(s).
                     */
-                   if (s->num_prompts) {
+                   {
                        int ret; /* not live over crReturn */
                        ret = get_userpass_input(s->cur_prompt, NULL, 0);
                        while (ret < 0) {
@@ -8068,7 +8069,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
                    }
 
                    /*
-                    * Send the responses to the server.
+                    * Send the response(s) to the server.
                     */
                    s->pktout = ssh2_pkt_init(SSH2_MSG_USERAUTH_INFO_RESPONSE);
                    ssh2_pkt_adduint32(s->pktout, s->num_prompts);