Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ssh.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6813 by doda, Wed Jun 21 10:08:55 2017 UTC revision 6815 by doda, Wed Jun 21 10:09:29 2017 UTC
# Line 3501  void SSH2_channel_input_eof(PTInstVar pv Line 3501  void SSH2_channel_input_eof(PTInstVar pv
3501          msg = buffer_init();          msg = buffer_init();
3502          if (msg == NULL) {          if (msg == NULL) {
3503                  // TODO: error check                  // TODO: error check
3504                    logputs(LOG_LEVEL_ERROR, __FUNCTION__ ": buffer_init returns NULL");
3505                  return;                  return;
3506          }          }
3507          buffer_put_int(msg, c->remote_id);  // remote ID          buffer_put_int(msg, c->remote_id);  // remote ID
# Line 3541  void SSH_request_forwarding(PTInstVar pv Line 3542  void SSH_request_forwarding(PTInstVar pv
3542          if (SSHv1(pvar)) {          if (SSHv1(pvar)) {
3543                  int host_len = strlen(to_local_host);                  int host_len = strlen(to_local_host);
3544                  unsigned char *outmsg =                  unsigned char *outmsg =
3545                          begin_send_packet(pvar, SSH_CMSG_PORT_FORWARD_REQUEST,                          begin_send_packet(pvar, SSH_CMSG_PORT_FORWARD_REQUEST, 12 + host_len);
3546                                            12 + host_len);  
3547                    logprintf(LOG_LEVEL_VERBOSE, __FUNCTION__ ": Forwarding request (SSH1 RtoL): "
3548                            "remote_port=%d, to_host=%s, to_port=%d",
3549                            from_server_port, to_local_host, to_local_port);
3550    
3551                  set_uint32(outmsg, from_server_port);                  set_uint32(outmsg, from_server_port);
3552                  set_uint32(outmsg + 4, host_len);                  set_uint32(outmsg + 4, host_len);
# Line 3552  void SSH_request_forwarding(PTInstVar pv Line 3556  void SSH_request_forwarding(PTInstVar pv
3556    
3557                  enque_forwarding_request_handlers(pvar);                  enque_forwarding_request_handlers(pvar);
3558    
3559                    logprintf(LOG_LEVEL_VERBOSE, __FUNCTION__ ": sending SSH_CMSG_PORT_FORWARD_REQUEST."
3560                            "remote_port=%d, to_host=%s, to_port=%d",
3561                            from_server_port, to_local_host, to_local_port);
3562    
3563          } else {          } else {
3564                  // SSH2 port-forwading remote to local (2005.6.21 yutaka)                  // SSH2 port-forwading remote to local (2005.6.21 yutaka)
3565                  buffer_t *msg;                  buffer_t *msg;
3566                  char *s;                  char *req;
3567                  unsigned char *outmsg;                  unsigned char *outmsg;
3568                  int len;                  int len;
3569    
3570                    logprintf(LOG_LEVEL_VERBOSE, __FUNCTION__ ": Forwarding request (SSH2 RtoL): "
3571                            "bind_addr=%s, remote_port=%d, to_host=%s, to_port=%d",
3572                            bind_address, from_server_port, to_local_host, to_local_port);
3573    
3574                  msg = buffer_init();                  msg = buffer_init();
3575                  if (msg == NULL) {                  if (msg == NULL) {
3576                          // TODO: error check                          // TODO: error check
3577                            logputs(LOG_LEVEL_ERROR, __FUNCTION__ ": buffer_init returns NULL");
3578                          return;                          return;
3579                  }                  }
3580                  s = "tcpip-forward";                  req = "tcpip-forward";
3581                  buffer_put_string(msg, s, strlen(s)); // ctype                  buffer_put_string(msg, req, strlen(req)); // ctype
3582                  buffer_put_char(msg, 1);  // want reply                  buffer_put_char(msg, 1);  // want reply
3583                  buffer_put_string(msg, bind_address, strlen(bind_address));                  buffer_put_string(msg, bind_address, strlen(bind_address));
3584    
# Line 3577  void SSH_request_forwarding(PTInstVar pv Line 3590  void SSH_request_forwarding(PTInstVar pv
3590                  finish_send_packet(pvar);                  finish_send_packet(pvar);
3591                  buffer_free(msg);                  buffer_free(msg);
3592    
3593                  logputs(LOG_LEVEL_VERBOSE, "SSH2_MSG_GLOBAL_REQUEST was sent at SSH_request_forwarding().");                  logprintf(LOG_LEVEL_VERBOSE, __FUNCTION__ ": sending SSH2_MSG_GLOBAL_REQUEST. "
3594                            "request=%s, want_reply=%d, bind_address=%s, remote_port=%d",
3595                            req, 1, bind_address, from_server_port);
3596          }          }
3597  }  }
3598    

Legend:
Removed from v.6813  
changed lines
  Added in v.6815

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26