[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.289 and 1.290

version 1.289, 2018/11/16 02:46:20 version 1.290, 2018/11/28 06:00:38
Line 950 
Line 950 
 {  {
         struct ssh *ssh = active_state; /* XXX */          struct ssh *ssh = active_state; /* XXX */
         static int attempt = 0;          static int attempt = 0;
         char prompt[256];          char *password, *prompt = NULL;
         char *password;  
         const char *host = options.host_key_alias ?  options.host_key_alias :          const char *host = options.host_key_alias ?  options.host_key_alias :
             authctxt->host;              authctxt->host;
         int r;          int r;
Line 962 
Line 961 
         if (attempt != 1)          if (attempt != 1)
                 error("Permission denied, please try again.");                  error("Permission denied, please try again.");
   
         snprintf(prompt, sizeof(prompt), "%.30s@%.128s's password: ",          xasprintf(&prompt, "%s@%s's password: ", authctxt->server_user, host);
             authctxt->server_user, host);  
         password = read_passphrase(prompt, 0);          password = read_passphrase(prompt, 0);
         if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 ||          if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 ||
             (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 ||              (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 ||
Line 975 
Line 973 
             (r = sshpkt_send(ssh)) != 0)              (r = sshpkt_send(ssh)) != 0)
                 fatal("%s: %s", __func__, ssh_err(r));                  fatal("%s: %s", __func__, ssh_err(r));
   
         if (password)          free(prompt);
           if (password != NULL)
                 freezero(password, strlen(password));                  freezero(password, strlen(password));
   
         ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ,          ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ,

Legend:
Removed from v.1.289  
changed lines
  Added in v.1.290