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

Diff for /src/usr.bin/ssh/ssh-keyscan.c between version 1.149 and 1.150

version 1.149, 2022/12/26 19:16:03 version 1.150, 2023/02/10 04:56:30
Line 32 
Line 32 
 #include "sshbuf.h"  #include "sshbuf.h"
 #include "sshkey.h"  #include "sshkey.h"
 #include "cipher.h"  #include "cipher.h"
   #include "digest.h"
 #include "kex.h"  #include "kex.h"
 #include "compat.h"  #include "compat.h"
 #include "myproposal.h"  #include "myproposal.h"
Line 72 
Line 73 
   
 int found_one = 0;              /* Successfully found a key */  int found_one = 0;              /* Successfully found a key */
   
   int hashalg = -1;               /* Hash for SSHFP records or -1 for all */
   
 #define MAXMAXFD 256  #define MAXMAXFD 256
   
 /* The number of seconds after which to give up on a TCP connection */  /* The number of seconds after which to give up on a TCP connection */
Line 294 
Line 297 
         found_one = 1;          found_one = 1;
   
         if (print_sshfp) {          if (print_sshfp) {
                 export_dns_rr(host, key, stdout, 0);                  export_dns_rr(host, key, stdout, 0, hashalg);
                 return;                  return;
         }          }
   
Line 678 
Line 681 
 usage(void)  usage(void)
 {  {
         fprintf(stderr,          fprintf(stderr,
             "usage: %s [-46cDHv] [-f file] [-p port] [-T timeout] [-t type]\n"              "usage: ssh-keyscan [-46cDHv] [-f file] [-p port] [-T timeout] [-t type]\n"
             "\t\t   [host | addrlist namelist]\n",              "                   [-O option] [host | addrlist namelist]\n");
             __progname);  
         exit(1);          exit(1);
 }  }
   
Line 704 
Line 706 
         if (argc <= 1)          if (argc <= 1)
                 usage();                  usage();
   
         while ((opt = getopt(argc, argv, "cDHv46p:T:t:f:")) != -1) {          while ((opt = getopt(argc, argv, "cDHv46O:p:T:t:f:")) != -1) {
                 switch (opt) {                  switch (opt) {
                 case 'H':                  case 'H':
                         hash_hosts = 1;                          hash_hosts = 1;
Line 743 
Line 745 
                         if (strcmp(optarg, "-") == 0)                          if (strcmp(optarg, "-") == 0)
                                 optarg = NULL;                                  optarg = NULL;
                         argv[fopt_count++] = optarg;                          argv[fopt_count++] = optarg;
                           break;
                   case 'O':
                           /* Maybe other misc options in the future too */
                           if (strncmp(optarg, "hashalg=", 8) != 0)
                                   fatal("Unsupported -O option");
                           if ((hashalg = ssh_digest_alg_by_name(
                               optarg + 8)) == -1)
                                   fatal("Unsupported hash algorithm");
                         break;                          break;
                 case 't':                  case 't':
                         get_keytypes = 0;                          get_keytypes = 0;

Legend:
Removed from v.1.149  
changed lines
  Added in v.1.150