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

Diff for /src/usr.bin/ssh/ssh-add.c between version 1.109 and 1.110

version 1.109, 2014/02/02 03:44:31 version 1.110, 2014/06/24 01:13:21
Line 58 
Line 58 
 #include "authfile.h"  #include "authfile.h"
 #include "pathnames.h"  #include "pathnames.h"
 #include "misc.h"  #include "misc.h"
   #include "ssherr.h"
   
 /* argv0 */  /* argv0 */
 extern char *__progname;  extern char *__progname;
Line 164 
Line 165 
         Key *private, *cert;          Key *private, *cert;
         char *comment = NULL;          char *comment = NULL;
         char msg[1024], *certpath = NULL;          char msg[1024], *certpath = NULL;
         int fd, perms_ok, ret = -1;          int r, fd, perms_ok, ret = -1;
         Buffer keyblob;          Buffer keyblob;
   
         if (strcmp(filename, "-") == 0) {          if (strcmp(filename, "-") == 0) {
Line 195 
Line 196 
         close(fd);          close(fd);
   
         /* At first, try empty passphrase */          /* At first, try empty passphrase */
         private = key_parse_private(&keyblob, filename, "", &comment);          if ((r = sshkey_parse_private_fileblob(&keyblob, filename, "",
               &private, &comment)) != 0 && r != SSH_ERR_KEY_WRONG_PASSPHRASE)
                           fatal("Cannot parse %s: %s", filename, ssh_err(r));
         if (comment == NULL)          if (comment == NULL)
                 comment = xstrdup(filename);                  comment = xstrdup(filename);
         /* try last */          /* try last */
         if (private == NULL && pass != NULL)          if (private == NULL && pass != NULL) {
                 private = key_parse_private(&keyblob, filename, pass, NULL);                  if ((r = sshkey_parse_private_fileblob(&keyblob, filename, pass,
                       &private, &comment)) != 0 &&
                       r != SSH_ERR_KEY_WRONG_PASSPHRASE)
                           fatal("Cannot parse %s: %s", filename, ssh_err(r));
           }
         if (private == NULL) {          if (private == NULL) {
                 /* clear passphrase since it did not work */                  /* clear passphrase since it did not work */
                 clear_pass();                  clear_pass();
Line 214 
Line 221 
                                 buffer_free(&keyblob);                                  buffer_free(&keyblob);
                                 return -1;                                  return -1;
                         }                          }
                         private = key_parse_private(&keyblob, filename, pass,                          if ((r = sshkey_parse_private_fileblob(&keyblob,
                             &comment);                               filename, pass, &private, &comment)) != 0 &&
                               r != SSH_ERR_KEY_WRONG_PASSPHRASE)
                                   fatal("Cannot parse %s: %s",
                                               filename, ssh_err(r));
                         if (private != NULL)                          if (private != NULL)
                                 break;                                  break;
                         clear_pass();                          clear_pass();

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.110