[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.55.2.1 and 1.55.2.2

version 1.55.2.1, 2006/02/03 03:01:57 version 1.55.2.2, 2006/10/06 03:19:33
Line 1 
Line 1 
   /* $OpenBSD$ */
 /*  /*
  * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.   * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
  *   *
Line 6 
Line 7 
  * OpenBSD project by leaving this copyright notice intact.   * OpenBSD project by leaving this copyright notice intact.
  */   */
   
 #include "includes.h"  #include <sys/types.h>
 RCSID("$OpenBSD$");  #include <sys/socket.h>
   
 #include <sys/queue.h>  #include <sys/queue.h>
 #include <errno.h>  #include <sys/time.h>
   #include <sys/resource.h>
   
 #include <openssl/bn.h>  #include <openssl/bn.h>
   
   #include <errno.h>
   #include <netdb.h>
 #include <setjmp.h>  #include <setjmp.h>
   #include <stdarg.h>
   #include <stdio.h>
   #include <stdlib.h>
   #include <signal.h>
   #include <string.h>
   #include <unistd.h>
   
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "ssh.h"  #include "ssh.h"
 #include "ssh1.h"  #include "ssh1.h"
   #include "buffer.h"
 #include "key.h"  #include "key.h"
   #include "cipher.h"
 #include "kex.h"  #include "kex.h"
 #include "compat.h"  #include "compat.h"
 #include "myproposal.h"  #include "myproposal.h"
 #include "packet.h"  #include "packet.h"
 #include "dispatch.h"  #include "dispatch.h"
 #include "buffer.h"  
 #include "bufaux.h"  
 #include "log.h"  #include "log.h"
 #include "atomicio.h"  #include "atomicio.h"
 #include "misc.h"  #include "misc.h"
Line 55 
Line 65 
   
 extern char *__progname;  extern char *__progname;
 fd_set *read_wait;  fd_set *read_wait;
 size_t read_wait_size;  size_t read_wait_nfdset;
 int ncon;  int ncon;
 int nonfatal_fatal = 0;  int nonfatal_fatal = 0;
 jmp_buf kexjmp;  jmp_buf kexjmp;
Line 129 
Line 139 
                 lb->stream = stdin;                  lb->stream = stdin;
         }          }
   
         if (!(lb->buf = malloc(lb->size = LINEBUF_SIZE))) {          if (!(lb->buf = malloc((lb->size = LINEBUF_SIZE)))) {
                 if (errfun)                  if (errfun)
                         (*errfun) ("linebuf (%s): malloc failed\n", lb->filename);                          (*errfun) ("linebuf (%s): malloc failed\n", lb->filename);
                 xfree(lb);                  xfree(lb);
Line 341 
Line 351 
         c->c_kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client;          c->c_kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client;
         c->c_kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client;          c->c_kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client;
         c->c_kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;          c->c_kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
           c->c_kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
         c->c_kex->verify_host_key = hostjump;          c->c_kex->verify_host_key = hostjump;
   
         if (!(j = setjmp(kexjmp))) {          if (!(j = setjmp(kexjmp))) {
Line 593 
Line 604 
                         keyprint(c, keygrab_ssh1(c));                          keyprint(c, keygrab_ssh1(c));
                         confree(s);                          confree(s);
                         return;                          return;
                         break;  
                 default:                  default:
                         fatal("conread: invalid status %d", c->c_status);                          fatal("conread: invalid status %d", c->c_status);
                         break;                          break;
Line 625 
Line 635 
         } else          } else
                 seltime.tv_sec = seltime.tv_usec = 0;                  seltime.tv_sec = seltime.tv_usec = 0;
   
         r = xmalloc(read_wait_size);          r = xcalloc(read_wait_nfdset, sizeof(fd_mask));
         memcpy(r, read_wait, read_wait_size);          e = xcalloc(read_wait_nfdset, sizeof(fd_mask));
         e = xmalloc(read_wait_size);          memcpy(r, read_wait, read_wait_nfdset * sizeof(fd_mask));
         memcpy(e, read_wait, read_wait_size);          memcpy(e, read_wait, read_wait_nfdset * sizeof(fd_mask));
   
         while (select(maxfd, r, NULL, e, &seltime) == -1 &&          while (select(maxfd, r, NULL, e, &seltime) == -1 &&
             (errno == EAGAIN || errno == EINTR))              (errno == EAGAIN || errno == EINTR))
Line 792 
Line 802 
                 fatal("%s: not enough file descriptors", __progname);                  fatal("%s: not enough file descriptors", __progname);
         if (maxfd > fdlim_get(0))          if (maxfd > fdlim_get(0))
                 fdlim_set(maxfd);                  fdlim_set(maxfd);
         fdcon = xmalloc(maxfd * sizeof(con));          fdcon = xcalloc(maxfd, sizeof(con));
         memset(fdcon, 0, maxfd * sizeof(con));  
   
         read_wait_size = howmany(maxfd, NFDBITS) * sizeof(fd_mask);          read_wait_nfdset = howmany(maxfd, NFDBITS);
         read_wait = xmalloc(read_wait_size);          read_wait = xcalloc(read_wait_nfdset, sizeof(fd_mask));
         memset(read_wait, 0, read_wait_size);  
   
         if (fopt_count) {          if (fopt_count) {
                 Linebuf *lb;                  Linebuf *lb;

Legend:
Removed from v.1.55.2.1  
changed lines
  Added in v.1.55.2.2