[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.116 and 1.117

version 1.116, 2017/11/25 06:46:22 version 1.117, 2018/02/23 05:14:05
Line 40 
Line 40 
 #include "hostfile.h"  #include "hostfile.h"
 #include "ssherr.h"  #include "ssherr.h"
 #include "ssh_api.h"  #include "ssh_api.h"
   #include "dns.h"
   
 /* Flag indicating whether IPv4 or IPv6.  This can be set on the command line.  /* Flag indicating whether IPv4 or IPv6.  This can be set on the command line.
    Default value is AF_UNSPEC means both IPv4 and IPv6. */     Default value is AF_UNSPEC means both IPv4 and IPv6. */
Line 60 
Line 61 
   
 int hash_hosts = 0;             /* Hash hostname on output */  int hash_hosts = 0;             /* Hash hostname on output */
   
   int print_sshfp = 0;            /* Print SSHFP records instead of known_hosts */
   
 #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 260 
Line 263 
         char *hostport;          char *hostport;
         const char *known_host, *hashed;          const char *known_host, *hashed;
   
           if (print_sshfp) {
                   export_dns_rr(host, key, stdout, 0);
                   return;
           }
   
         hostport = put_host_port(host, ssh_port);          hostport = put_host_port(host, ssh_port);
         lowercase(hostport);          lowercase(hostport);
         if (hash_hosts && (hashed = host_hash(host, NULL, 0)) == NULL)          if (hash_hosts && (hashed = host_hash(host, NULL, 0)) == NULL)
Line 477 
Line 485 
                 confree(s);                  confree(s);
                 return;                  return;
         }          }
         fprintf(stderr, "# %s:%d %s\n", c->c_name, ssh_port, chop(buf));          fprintf(stderr, "%c %s:%d %s\n", print_sshfp ? ';' : '#',
               c->c_name, ssh_port, chop(buf));
         keygrab_ssh2(c);          keygrab_ssh2(c);
         confree(s);          confree(s);
 }  }
Line 601 
Line 610 
 usage(void)  usage(void)
 {  {
         fprintf(stderr,          fprintf(stderr,
             "usage: %s [-46cHv] [-f file] [-p port] [-T timeout] [-t type]\n"              "usage: %s [-46cDHv] [-f file] [-p port] [-T timeout] [-t type]\n"
             "\t\t   [host | addrlist namelist] ...\n",              "\t\t   [host | addrlist namelist] ...\n",
             __progname);              __progname);
         exit(1);          exit(1);
Line 628 
Line 637 
         if (argc <= 1)          if (argc <= 1)
                 usage();                  usage();
   
         while ((opt = getopt(argc, argv, "cHv46p:T:t:f:")) != -1) {          while ((opt = getopt(argc, argv, "cDHv46p:T:t:f:")) != -1) {
                 switch (opt) {                  switch (opt) {
                 case 'H':                  case 'H':
                         hash_hosts = 1;                          hash_hosts = 1;
                         break;                          break;
                 case 'c':                  case 'c':
                         get_cert = 1;                          get_cert = 1;
                           break;
                   case 'D':
                           print_sshfp = 1;
                         break;                          break;
                 case 'p':                  case 'p':
                         ssh_port = a2port(optarg);                          ssh_port = a2port(optarg);

Legend:
Removed from v.1.116  
changed lines
  Added in v.1.117