[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.329 and 1.330

version 1.329, 2019/03/25 16:19:44 version 1.330, 2019/05/29 08:30:26
Line 1467 
Line 1467 
                 exit(1);                  exit(1);
         }          }
         if (comment)          if (comment)
                 printf("Key now has comment '%s'\n", comment);                  printf("Old comment: %s\n", comment);
         else          else
                 printf("Key now has no comment\n");                  printf("No existing comment\n");
   
         if (identity_comment) {          if (identity_comment) {
                 strlcpy(new_comment, identity_comment, sizeof(new_comment));                  strlcpy(new_comment, identity_comment, sizeof(new_comment));
         } else {          } else {
                 printf("Enter new comment: ");                  printf("New comment: ");
                 fflush(stdout);                  fflush(stdout);
                 if (!fgets(new_comment, sizeof(new_comment), stdin)) {                  if (!fgets(new_comment, sizeof(new_comment), stdin)) {
                         explicit_bzero(passphrase, strlen(passphrase));                          explicit_bzero(passphrase, strlen(passphrase));
Line 1483 
Line 1483 
                 }                  }
                 new_comment[strcspn(new_comment, "\n")] = '\0';                  new_comment[strcspn(new_comment, "\n")] = '\0';
         }          }
           if (comment != NULL && strcmp(comment, new_comment) == 0) {
                   printf("No change to comment\n");
                   free(passphrase);
                   sshkey_free(private);
                   free(comment);
                   exit(0);
           }
   
         /* Save the file using the new passphrase. */          /* Save the file using the new passphrase. */
         if ((r = sshkey_save_private(private, identity_file, passphrase,          if ((r = sshkey_save_private(private, identity_file, passphrase,
Line 1516 
Line 1523 
   
         free(comment);          free(comment);
   
         printf("The comment in your key file has been changed.\n");          if (strlen(new_comment) > 0)
                   printf("Comment '%s' applied\n", new_comment);
           else
                   printf("Comment removed\n");
   
         exit(0);          exit(0);
 }  }
   

Legend:
Removed from v.1.329  
changed lines
  Added in v.1.330