[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.316 and 1.317

version 1.316, 2018/06/01 04:21:29 version 1.317, 2018/06/06 18:29:18
Line 856 
Line 856 
 {  {
         FILE *f;          FILE *f;
         struct sshkey *public = NULL;          struct sshkey *public = NULL;
         char *comment = NULL, *cp, *ep, line[SSH_MAX_PUBKEY_BYTES];          char *comment = NULL, *cp, *ep, *line = NULL;
           size_t linesize = 0;
         int i, invalid = 1;          int i, invalid = 1;
         const char *path;          const char *path;
         u_long lnum = 0;          u_long lnum = 0;
Line 871 
Line 872 
         } else if ((f = fopen(path, "r")) == NULL)          } else if ((f = fopen(path, "r")) == NULL)
                 fatal("%s: %s: %s", __progname, path, strerror(errno));                  fatal("%s: %s: %s", __progname, path, strerror(errno));
   
         while (read_keyfile_line(f, path, line, sizeof(line), &lnum) == 0) {          while (getline(&line, &linesize, f) != -1) {
                   lnum++;
                 cp = line;                  cp = line;
                 cp[strcspn(cp, "\n")] = '\0';                  cp[strcspn(cp, "\n")] = '\0';
                 /* Trim leading space and comments */                  /* Trim leading space and comments */
Line 891 
Line 893 
                  */                   */
                 if (lnum == 1 && strcmp(identity_file, "-") != 0 &&                  if (lnum == 1 && strcmp(identity_file, "-") != 0 &&
                     strstr(cp, "PRIVATE KEY") != NULL) {                      strstr(cp, "PRIVATE KEY") != NULL) {
                           free(line);
                         fclose(f);                          fclose(f);
                         fingerprint_private(path);                          fingerprint_private(path);
                         exit(0);                          exit(0);
Line 937 
Line 940 
                 invalid = 0; /* One good key in the file is sufficient */                  invalid = 0; /* One good key in the file is sufficient */
         }          }
         fclose(f);          fclose(f);
           free(line);
   
         if (invalid)          if (invalid)
                 fatal("%s is not a public key file.", path);                  fatal("%s is not a public key file.", path);
Line 1988 
Line 1992 
         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[SSH_MAX_PUBKEY_BYTES];          char *cp, *line = NULL;
         const char *path;          const char *path;
           size_t linesize = 0;
         u_long lnum = 0;          u_long lnum = 0;
   
         if (!have_identity)          if (!have_identity)
Line 2005 
Line 2010 
         } else if ((f = fopen(identity_file, "r")) == NULL)          } else if ((f = fopen(identity_file, "r")) == NULL)
                 fatal("fopen %s: %s", identity_file, strerror(errno));                  fatal("fopen %s: %s", identity_file, strerror(errno));
   
         while (read_keyfile_line(f, path, line, sizeof(line), &lnum) == 0) {          while (getline(&line, &linesize, f) != -1) {
                   lnum++;
                 sshkey_free(key);                  sshkey_free(key);
                 key = NULL;                  key = NULL;
                 /* Trim leading space and comments */                  /* Trim leading space and comments */
Line 2030 
Line 2036 
                         printf("%s:%lu:\n", path, lnum);                          printf("%s:%lu:\n", path, lnum);
                 print_cert(key);                  print_cert(key);
         }          }
           free(line);
         sshkey_free(key);          sshkey_free(key);
         fclose(f);          fclose(f);
         exit(ok ? 0 : 1);          exit(ok ? 0 : 1);
Line 2062 
Line 2069 
 {  {
         struct sshkey *key = NULL;          struct sshkey *key = NULL;
         u_long lnum = 0;          u_long lnum = 0;
         char *path, *cp, *ep, line[SSH_MAX_PUBKEY_BYTES];          char *path, *cp, *ep, *line = NULL;
           size_t linesize = 0;
         unsigned long long serial, serial2;          unsigned long long serial, serial2;
         int i, was_explicit_key, was_sha1, r;          int i, was_explicit_key, was_sha1, r;
         FILE *krl_spec;          FILE *krl_spec;
Line 2077 
Line 2085 
   
         if (!quiet)          if (!quiet)
                 printf("Revoking from %s\n", path);                  printf("Revoking from %s\n", path);
         while (read_keyfile_line(krl_spec, path, line, sizeof(line),          while (getline(&line, &linesize, krl_spec) != -1) {
             &lnum) == 0) {                  lnum++;
                 was_explicit_key = was_sha1 = 0;                  was_explicit_key = was_sha1 = 0;
                 cp = line + strspn(line, " \t");                  cp = line + strspn(line, " \t");
                 /* Trim trailing space, comments and strip \n */                  /* Trim trailing space, comments and strip \n */
Line 2178 
Line 2186 
         }          }
         if (strcmp(path, "-") != 0)          if (strcmp(path, "-") != 0)
                 fclose(krl_spec);                  fclose(krl_spec);
           free(line);
         free(path);          free(path);
 }  }
   

Legend:
Removed from v.1.316  
changed lines
  Added in v.1.317