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

Diff for /src/usr.bin/ssh/authfd.c between version 1.126 and 1.127

version 1.126, 2020/10/29 02:52:43 version 1.127, 2021/01/26 00:46:17
Line 176 
Line 176 
         return 0;          return 0;
 }  }
   
   /* Communicate with agent: sent request, read and decode status reply */
   static int
   ssh_request_reply_decode(int sock, struct sshbuf *request)
   {
           struct sshbuf *reply;
           int r;
           u_char type;
   
           if ((reply = sshbuf_new()) == NULL)
                   return SSH_ERR_ALLOC_FAIL;
           if ((r = ssh_request_reply(sock, request, reply)) != 0 ||
               (r = sshbuf_get_u8(reply, &type)) != 0 ||
               (r = decode_reply(type)) != 0)
                   goto out;
           /* success */
           r = 0;
    out:
           sshbuf_free(reply);
           return r;
   }
   
 /*  /*
  * Closes the agent socket if it should be closed (depends on how it was   * Closes the agent socket if it should be closed (depends on how it was
  * obtained).  The argument must have been returned by   * obtained).  The argument must have been returned by
Line 199 
Line 220 
         if ((msg = sshbuf_new()) == NULL)          if ((msg = sshbuf_new()) == NULL)
                 return SSH_ERR_ALLOC_FAIL;                  return SSH_ERR_ALLOC_FAIL;
         if ((r = sshbuf_put_u8(msg, type)) != 0 ||          if ((r = sshbuf_put_u8(msg, type)) != 0 ||
             (r = sshbuf_put_cstring(msg, password)) != 0)              (r = sshbuf_put_cstring(msg, password)) != 0 ||
               (r = ssh_request_reply_decode(sock, msg)) != 0)
                 goto out;                  goto out;
         if ((r = ssh_request_reply(sock, msg, msg)) != 0)          /* success */
                 goto out;          r = 0;
         if ((r = sshbuf_get_u8(msg, &type)) != 0)  
                 goto out;  
         r = decode_reply(type);  
  out:   out:
         sshbuf_free(msg);          sshbuf_free(msg);
         return r;          return r;
Line 518 
Line 537 
             (r = encode_constraints(msg, life, confirm, maxsign,              (r = encode_constraints(msg, life, confirm, maxsign,
             provider)) != 0)              provider)) != 0)
                 goto out;                  goto out;
         if ((r = ssh_request_reply(sock, msg, msg)) != 0)          if ((r = ssh_request_reply_decode(sock, msg)) != 0)
                 goto out;                  goto out;
         if ((r = sshbuf_get_u8(msg, &type)) != 0)          /* success */
                 goto out;          r = 0;
         r = decode_reply(type);  
  out:   out:
         sshbuf_free(msg);          sshbuf_free(msg);
         return r;          return r;
Line 537 
Line 555 
 {  {
         struct sshbuf *msg;          struct sshbuf *msg;
         int r;          int r;
         u_char type, *blob = NULL;          u_char *blob = NULL;
         size_t blen;          size_t blen;
   
         if ((msg = sshbuf_new()) == NULL)          if ((msg = sshbuf_new()) == NULL)
Line 554 
Line 572 
                 r = SSH_ERR_INVALID_ARGUMENT;                  r = SSH_ERR_INVALID_ARGUMENT;
                 goto out;                  goto out;
         }          }
         if ((r = ssh_request_reply(sock, msg, msg)) != 0)          if ((r = ssh_request_reply_decode(sock, msg)) != 0)
                 goto out;                  goto out;
         if ((r = sshbuf_get_u8(msg, &type)) != 0)          /* success */
                 goto out;          r = 0;
         r = decode_reply(type);  
  out:   out:
         if (blob != NULL)          if (blob != NULL)
                 freezero(blob, blen);                  freezero(blob, blen);
Line 594 
Line 611 
         if (constrained &&          if (constrained &&
             (r = encode_constraints(msg, life, confirm, 0, NULL)) != 0)              (r = encode_constraints(msg, life, confirm, 0, NULL)) != 0)
                 goto out;                  goto out;
         if ((r = ssh_request_reply(sock, msg, msg)) != 0)          if ((r = ssh_request_reply_decode(sock, msg)) != 0)
                 goto out;                  goto out;
         if ((r = sshbuf_get_u8(msg, &type)) != 0)          /* success */
                 goto out;          r = 0;
         r = decode_reply(type);  
  out:   out:
         sshbuf_free(msg);          sshbuf_free(msg);
         return r;          return r;
Line 625 
Line 641 
                 return SSH_ERR_ALLOC_FAIL;                  return SSH_ERR_ALLOC_FAIL;
         if ((r = sshbuf_put_u8(msg, type)) != 0)          if ((r = sshbuf_put_u8(msg, type)) != 0)
                 goto out;                  goto out;
         if ((r = ssh_request_reply(sock, msg, msg)) != 0)          if ((r = ssh_request_reply_decode(sock, msg)) != 0)
                 goto out;                  goto out;
         if ((r = sshbuf_get_u8(msg, &type)) != 0)          /* success */
                 goto out;          r = 0;
         r = decode_reply(type);  
  out:   out:
         sshbuf_free(msg);          sshbuf_free(msg);
         return r;          return r;

Legend:
Removed from v.1.126  
changed lines
  Added in v.1.127