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

Diff for /src/usr.bin/ssh/ssh-keygen.c between version 1.284 and 1.292

version 1.284, 2015/11/28 06:50:52 version 1.292, 2016/09/12 03:29:16
Line 200 
Line 200 
                                 *bitsp = sshkey_curve_nid_to_bits(nid);                                  *bitsp = sshkey_curve_nid_to_bits(nid);
                         if (*bitsp == 0)                          if (*bitsp == 0)
                                 *bitsp = DEFAULT_BITS_ECDSA;                                  *bitsp = DEFAULT_BITS_ECDSA;
                 }                  } else
                 else  
 #endif  #endif
                         *bitsp = DEFAULT_BITS;                          *bitsp = DEFAULT_BITS;
         }          }
Line 514 
Line 513 
         sshbuf_free(b);          sshbuf_free(b);
   
         /* try the key */          /* try the key */
         if (sshkey_sign(key, &sig, &slen, data, sizeof(data), 0) != 0 ||          if (sshkey_sign(key, &sig, &slen, data, sizeof(data), NULL, 0) != 0 ||
             sshkey_verify(key, sig, slen, data, sizeof(data), 0) != 0) {              sshkey_verify(key, sig, slen, data, sizeof(data), 0) != 0) {
                 sshkey_free(key);                  sshkey_free(key);
                 free(sig);                  free(sig);
Line 867 
Line 866 
 {  {
         FILE *f;          FILE *f;
         struct sshkey *public = NULL;          struct sshkey *public = NULL;
         char *comment = NULL, *cp, *ep, line[16*1024];          char *comment = NULL, *cp, *ep, line[SSH_MAX_PUBKEY_BYTES];
         int i, invalid = 1;          int i, invalid = 1;
         const char *path;          const char *path;
         long int lnum = 0;          u_long lnum = 0;
   
         if (!have_identity)          if (!have_identity)
                 ask_filename(pw, "Enter file in which the key is");                  ask_filename(pw, "Enter file in which the key is");
Line 933 
Line 932 
                 }                  }
                 /* Retry after parsing leading hostname/key options */                  /* Retry after parsing leading hostname/key options */
                 if (public == NULL && (public = try_read_key(&cp)) == NULL) {                  if (public == NULL && (public = try_read_key(&cp)) == NULL) {
                         debug("%s:%ld: not a public key", path, lnum);                          debug("%s:%lu: not a public key", path, lnum);
                         continue;                          continue;
                 }                  }
   
Line 1584 
Line 1583 
                 ca = load_identity(tmp);                  ca = load_identity(tmp);
         free(tmp);          free(tmp);
   
           if (key_type_name != NULL &&
               sshkey_type_from_name(key_type_name) != ca->type)  {
                   fatal("CA key type %s doesn't match specified %s",
                       sshkey_ssh_name(ca), key_type_name);
           }
   
         for (i = 0; i < argc; i++) {          for (i = 0; i < argc; i++) {
                 /* Split list of principals */                  /* Split list of principals */
                 n = 0;                  n = 0;
Line 1625 
Line 1630 
                     &public->cert->signature_key)) != 0)                      &public->cert->signature_key)) != 0)
                         fatal("key_from_private (ca key): %s", ssh_err(r));                          fatal("key_from_private (ca key): %s", ssh_err(r));
   
                 if (sshkey_certify(public, ca) != 0)                  if ((r = sshkey_certify(public, ca, key_type_name)) != 0)
                         fatal("Couldn't not certify key %s", tmp);                          fatal("Couldn't certify key %s: %s", tmp, ssh_err(r));
   
                 if ((cp = strrchr(tmp, '.')) != NULL && strcmp(cp, ".pub") == 0)                  if ((cp = strrchr(tmp, '.')) != NULL && strcmp(cp, ".pub") == 0)
                         *cp = '\0';                          *cp = '\0';
Line 1903 
Line 1908 
         struct stat st;          struct stat st;
         int r, is_stdin = 0, ok = 0;          int r, is_stdin = 0, ok = 0;
         FILE *f;          FILE *f;
         char *cp, line[2048];          char *cp, line[SSH_MAX_PUBKEY_BYTES];
         const char *path;          const char *path;
         long int lnum = 0;          u_long lnum = 0;
   
         if (!have_identity)          if (!have_identity)
                 ask_filename(pw, "Enter file in which the key is");                  ask_filename(pw, "Enter file in which the key is");
Line 2152 
Line 2157 
         close(fd);          close(fd);
         sshbuf_free(kbuf);          sshbuf_free(kbuf);
         ssh_krl_free(krl);          ssh_krl_free(krl);
         if (ca != NULL)          sshkey_free(ca);
                 sshkey_free(ca);  
 }  }
   
 static void  static void
Line 2249 
Line 2253 
         extern int optind;          extern int optind;
         extern char *optarg;          extern char *optarg;
   
           ssh_malloc_init();      /* must be called before any mallocs */
         /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */          /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
         sanitise_stdfd();          sanitise_stdfd();
   
Line 2431 
Line 2436 
                         break;                          break;
                 case 'J':                  case 'J':
                         lines_to_process = strtoul(optarg, NULL, 10);                          lines_to_process = strtoul(optarg, NULL, 10);
                         break;                          break;
                 case 'j':                  case 'j':
                         start_lineno = strtoul(optarg, NULL, 10);                          start_lineno = strtoul(optarg, NULL, 10);
                         break;                          break;
                 case 'K':                  case 'K':
                         if (strlen(optarg) >= PATH_MAX)                          if (strlen(optarg) >= PATH_MAX)
                                 fatal("Checkpoint filename too long");                                  fatal("Checkpoint filename too long");

Legend:
Removed from v.1.284  
changed lines
  Added in v.1.292