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

Diff for /src/usr.bin/ssh/ssh-agent.c between version 1.268 and 1.269

version 1.268, 2021/01/11 02:12:58 version 1.269, 2021/01/26 00:47:47
Line 161 
Line 161 
 close_socket(SocketEntry *e)  close_socket(SocketEntry *e)
 {  {
         close(e->fd);          close(e->fd);
         e->fd = -1;  
         e->type = AUTH_UNUSED;  
         sshbuf_free(e->input);          sshbuf_free(e->input);
         sshbuf_free(e->output);          sshbuf_free(e->output);
         sshbuf_free(e->request);          sshbuf_free(e->request);
           memset(e, '\0', sizeof(*e));
           e->fd = -1;
           e->type = AUTH_UNUSED;
 }  }
   
 static void  static void
Line 235 
Line 236 
         struct sshbuf *msg;          struct sshbuf *msg;
         int r;          int r;
   
           debug2_f("entering");
   
         if ((msg = sshbuf_new()) == NULL)          if ((msg = sshbuf_new()) == NULL)
                 fatal_f("sshbuf_new failed");                  fatal_f("sshbuf_new failed");
         if ((r = sshbuf_put_u8(msg, SSH2_AGENT_IDENTITIES_ANSWER)) != 0 ||          if ((r = sshbuf_put_u8(msg, SSH2_AGENT_IDENTITIES_ANSWER)) != 0 ||
Line 427 
Line 430 
         struct sshkey *key = NULL;          struct sshkey *key = NULL;
         Identity *id;          Identity *id;
   
           debug2_f("entering");
         if ((r = sshkey_froms(e->request, &key)) != 0) {          if ((r = sshkey_froms(e->request, &key)) != 0) {
                 error_fr(r, "parse key");                  error_fr(r, "parse key");
                 goto done;                  goto done;
Line 452 
Line 456 
 {  {
         Identity *id;          Identity *id;
   
           debug2_f("entering");
         /* Loop over all identities and clear the keys. */          /* Loop over all identities and clear the keys. */
         for (id = TAILQ_FIRST(&idtab->idlist); id;          for (id = TAILQ_FIRST(&idtab->idlist); id;
             id = TAILQ_FIRST(&idtab->idlist)) {              id = TAILQ_FIRST(&idtab->idlist)) {
Line 505 
Line 510 
         u_char ctype;          u_char ctype;
         int r = SSH_ERR_INTERNAL_ERROR;          int r = SSH_ERR_INTERNAL_ERROR;
   
           debug2_f("entering");
         if ((r = sshkey_private_deserialize(e->request, &k)) != 0 ||          if ((r = sshkey_private_deserialize(e->request, &k)) != 0 ||
             k == NULL ||              k == NULL ||
             (r = sshbuf_get_cstring(e->request, &comment, NULL)) != 0) {              (r = sshbuf_get_cstring(e->request, &comment, NULL)) != 0) {
Line 646 
Line 652 
         static u_int fail_count = 0;          static u_int fail_count = 0;
         size_t pwlen;          size_t pwlen;
   
           debug2_f("entering");
         /*          /*
          * This is deliberately fatal: the user has requested that we lock,           * This is deliberately fatal: the user has requested that we lock,
          * but we can't parse their request properly. The only safe thing to           * but we can't parse their request properly. The only safe thing to
Line 716 
Line 723 
         struct sshkey **keys = NULL, *k;          struct sshkey **keys = NULL, *k;
         Identity *id;          Identity *id;
   
           debug2_f("entering");
         if ((r = sshbuf_get_cstring(e->request, &provider, NULL)) != 0 ||          if ((r = sshbuf_get_cstring(e->request, &provider, NULL)) != 0 ||
             (r = sshbuf_get_cstring(e->request, &pin, NULL)) != 0) {              (r = sshbuf_get_cstring(e->request, &pin, NULL)) != 0) {
                 error_fr(r, "parse");                  error_fr(r, "parse");
Line 795 
Line 803 
         int r, success = 0;          int r, success = 0;
         Identity *id, *nxt;          Identity *id, *nxt;
   
           debug2_f("entering");
         if ((r = sshbuf_get_cstring(e->request, &provider, NULL)) != 0 ||          if ((r = sshbuf_get_cstring(e->request, &provider, NULL)) != 0 ||
             (r = sshbuf_get_cstring(e->request, &pin, NULL)) != 0) {              (r = sshbuf_get_cstring(e->request, &pin, NULL)) != 0) {
                 error_fr(r, "parse");                  error_fr(r, "parse");
Line 937 
Line 946 
 {  {
         u_int i, old_alloc, new_alloc;          u_int i, old_alloc, new_alloc;
   
           debug_f("type = %s", type == AUTH_CONNECTION ? "CONNECTION" :
               (type == AUTH_SOCKET ? "SOCKET" : "UNKNOWN"));
         set_nonblock(fd);          set_nonblock(fd);
   
         if (fd > max_fd)          if (fd > max_fd)
Line 954 
Line 965 
                 }                  }
         old_alloc = sockets_alloc;          old_alloc = sockets_alloc;
         new_alloc = sockets_alloc + 10;          new_alloc = sockets_alloc + 10;
         sockets = xreallocarray(sockets, new_alloc, sizeof(sockets[0]));          sockets = xrecallocarray(sockets, old_alloc, new_alloc,
               sizeof(sockets[0]));
         for (i = old_alloc; i < new_alloc; i++)          for (i = old_alloc; i < new_alloc; i++)
                 sockets[i].type = AUTH_UNUSED;                  sockets[i].type = AUTH_UNUSED;
         sockets_alloc = new_alloc;          sockets_alloc = new_alloc;

Legend:
Removed from v.1.268  
changed lines
  Added in v.1.269