[BACK]Return to sshconnect2.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/sshconnect2.c between version 1.334 and 1.335

version 1.334, 2020/11/08 22:37:24 version 1.335, 2020/11/13 04:53:12
Line 1879 
Line 1879 
 {  {
         Authctxt *authctxt = ssh->authctxt;          Authctxt *authctxt = ssh->authctxt;
         char *name = NULL, *inst = NULL, *lang = NULL, *prompt = NULL;          char *name = NULL, *inst = NULL, *lang = NULL, *prompt = NULL;
         char *response = NULL;          char *display_prompt = NULL, *response = NULL;
         u_char echo = 0;          u_char echo = 0;
         u_int num_prompts, i;          u_int num_prompts, i;
         int r;          int r;
   
         debug2("input_userauth_info_req");          debug2_f("entering");
   
         if (authctxt == NULL)          if (authctxt == NULL)
                 fatal("input_userauth_info_req: no authentication context");                  fatal_f("no authentication context");
   
         authctxt->info_req_seen = 1;          authctxt->info_req_seen = 1;
   
Line 1912 
Line 1912 
             (r = sshpkt_put_u32(ssh, num_prompts)) != 0)              (r = sshpkt_put_u32(ssh, num_prompts)) != 0)
                 goto out;                  goto out;
   
         debug2("input_userauth_info_req: num_prompts %d", num_prompts);          debug2_f("num_prompts %d", num_prompts);
         for (i = 0; i < num_prompts; i++) {          for (i = 0; i < num_prompts; i++) {
                 if ((r = sshpkt_get_cstring(ssh, &prompt, NULL)) != 0 ||                  if ((r = sshpkt_get_cstring(ssh, &prompt, NULL)) != 0 ||
                     (r = sshpkt_get_u8(ssh, &echo)) != 0)                      (r = sshpkt_get_u8(ssh, &echo)) != 0)
                         goto out;                          goto out;
                 response = read_passphrase(prompt, echo ? RP_ECHO : 0);                  xasprintf(&display_prompt, "(%s@%s) %s",
                       authctxt->server_user, options.host_key_alias ?
                       options.host_key_alias : authctxt->host, prompt);
                   response = read_passphrase(display_prompt, echo ? RP_ECHO : 0);
                 if ((r = sshpkt_put_cstring(ssh, response)) != 0)                  if ((r = sshpkt_put_cstring(ssh, response)) != 0)
                         goto out;                          goto out;
                 freezero(response, strlen(response));                  freezero(response, strlen(response));
                 free(prompt);                  free(prompt);
                 response = prompt = NULL;                  free(display_prompt);
                   display_prompt = response = prompt = NULL;
         }          }
         /* done with parsing incoming message. */          /* done with parsing incoming message. */
         if ((r = sshpkt_get_end(ssh)) != 0 ||          if ((r = sshpkt_get_end(ssh)) != 0 ||
Line 1933 
Line 1937 
         if (response)          if (response)
                 freezero(response, strlen(response));                  freezero(response, strlen(response));
         free(prompt);          free(prompt);
           free(display_prompt);
         free(name);          free(name);
         free(inst);          free(inst);
         free(lang);          free(lang);

Legend:
Removed from v.1.334  
changed lines
  Added in v.1.335