Lines Matching +full:forward +full:- +full:channel
62 #include "openbsd-compat/sys-queue.h"
80 #include "auth-options.h"
122 * send a bogus global/channel request with "wantreply", in client_alive_check()
125 if ((channel_id = channel_find_open(ssh)) == -1) { in client_alive_check()
160 /* Prepare channel poll. First two pollfd entries are reserved */ in wait_until_can_do_something()
220 if (ret == -1) { in wait_until_can_do_something()
271 return -1; in process_input()
278 return -1; in process_input()
310 while ((pid = waitpid(-1, &status, WNOHANG)) > 0 || in collect_children()
311 (pid == -1 && errno == EINTR)) in collect_children()
329 if (sigemptyset(&bsigset) == -1 || sigaddset(&bsigset, SIGCHLD) == -1) in server_loop2()
350 if (sigprocmask(SIG_BLOCK, &bsigset, &osigset) == -1) in server_loop2()
356 if (sigprocmask(SIG_SETMASK, &osigset, NULL) == -1) in server_loop2()
392 static Channel *
395 Channel *c = NULL; in server_request_direct_tcpip()
422 auth_opts->permit_port_forwarding_flag && in server_request_direct_tcpip()
425 "direct-tcpip", "direct-tcpip", reason, errmsg); in server_request_direct_tcpip()
427 logit("refused local port forward: " in server_request_direct_tcpip()
440 static Channel *
443 Channel *c = NULL; in server_request_direct_streamlocal()
446 struct passwd *pw = the_authctxt->pw; in server_request_direct_streamlocal()
449 if (pw == NULL || !the_authctxt->valid) in server_request_direct_streamlocal()
467 auth_opts->permit_port_forwarding_flag && in server_request_direct_streamlocal()
470 "direct-streamlocal@openssh.com", "direct-streamlocal"); in server_request_direct_streamlocal()
472 logit("refused streamlocal port forward: " in server_request_direct_streamlocal()
483 static Channel *
486 Channel *c = NULL; in server_request_tun()
513 if (auth_opts->force_tun_device != -1) { in server_request_tun()
515 auth_opts->force_tun_device != (int)tun) in server_request_tun()
517 tun = auth_opts->force_tun_device; in server_request_tun()
524 c = channel_new(ssh, "tun", SSH_CHANNEL_OPEN, sock, sock, -1, in server_request_tun()
526 c->datagram = 1; in server_request_tun()
529 channel_register_filter(ssh, c->self, sys_tun_infilter, in server_request_tun()
552 static Channel *
555 Channel *c; in server_request_session()
574 -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT, in server_request_session()
575 0, "server-session", 1); in server_request_session()
576 if (session_open(the_authctxt, c->self) != 1) { in server_request_session()
577 debug("session open failed, free channel %d", c->self); in server_request_session()
581 channel_register_cleanup(ssh, c->self, session_close_by_channel, 0); in server_request_session()
588 Channel *c = NULL; in server_input_channel_open()
604 } else if (strcmp(ctype, "direct-tcpip") == 0) { in server_input_channel_open()
606 } else if (strcmp(ctype, "direct-streamlocal@openssh.com") == 0) { in server_input_channel_open()
613 c->remote_id = rchan; in server_input_channel_open()
614 c->have_remote_id = 1; in server_input_channel_open()
615 c->remote_window = rwindow; in server_input_channel_open()
616 c->remote_maxpacket = rmaxpack; in server_input_channel_open()
617 if (c->type != SSH_CHANNEL_CONNECTING) { in server_input_channel_open()
619 (r = sshpkt_put_u32(ssh, c->remote_id)) != 0 || in server_input_channel_open()
620 (r = sshpkt_put_u32(ssh, c->self)) != 0 || in server_input_channel_open()
621 (r = sshpkt_put_u32(ssh, c->local_window)) != 0 || in server_input_channel_open()
622 (r = sshpkt_put_u32(ssh, c->local_maxpacket)) != 0 || in server_input_channel_open()
659 ssh->kex->hostkey_alg)) == KEY_RSA) in server_input_hostkeys_prove()
660 kex_rsa_sigalg = ssh->kex->hostkey_alg; in server_input_hostkeys_prove()
673 if ((ndx = ssh->kex->host_key_index(key, 1, ssh)) == -1) { in server_input_hostkeys_prove()
678 * XXX refactor: make kex->sign just use an index rather in server_input_hostkeys_prove()
694 if (sshkey_type_plain(key->type) == KEY_RSA) { in server_input_hostkeys_prove()
697 else if (ssh->kex->flags & KEX_RSA_SHA2_512_SUPPORTED) in server_input_hostkeys_prove()
698 sigalg = "rsa-sha2-512"; in server_input_hostkeys_prove()
699 else if (ssh->kex->flags & KEX_RSA_SHA2_256_SUPPORTED) in server_input_hostkeys_prove()
700 sigalg = "rsa-sha2-256"; in server_input_hostkeys_prove()
706 "hostkeys-prove-00@openssh.com")) != 0 || in server_input_hostkeys_prove()
708 ssh->kex->session_id)) != 0 || in server_input_hostkeys_prove()
710 (r = ssh->kex->sign(ssh, key_prv, key_pub, &sig, &slen, in server_input_hostkeys_prove()
737 struct passwd *pw = the_authctxt->pw; in server_input_global_request()
738 struct Forward fwd; in server_input_global_request()
741 if (pw == NULL || !the_authctxt->valid) in server_input_global_request()
749 /* -R style forwarding */ in server_input_global_request()
750 if (strcmp(rtype, "tcpip-forward") == 0) { in server_input_global_request()
753 sshpkt_fatal(ssh, r, "%s: parse tcpip-forward", __func__); in server_input_global_request()
754 debug_f("tcpip-forward listen %s port %u", in server_input_global_request()
761 !auth_opts->permit_port_forwarding_flag || in server_input_global_request()
776 } else if (strcmp(rtype, "cancel-tcpip-forward") == 0) { in server_input_global_request()
779 sshpkt_fatal(ssh, r, "%s: parse cancel-tcpip-forward", __func__); in server_input_global_request()
781 debug_f("cancel-tcpip-forward addr %s port %d", in server_input_global_request()
787 } else if (strcmp(rtype, "streamlocal-forward@openssh.com") == 0) { in server_input_global_request()
789 sshpkt_fatal(ssh, r, "%s: parse streamlocal-forward@openssh.com", __func__); in server_input_global_request()
790 debug_f("streamlocal-forward listen path %s", in server_input_global_request()
795 || !auth_opts->permit_port_forwarding_flag || in server_input_global_request()
805 } else if (strcmp(rtype, "cancel-streamlocal-forward@openssh.com") == 0) { in server_input_global_request()
807 sshpkt_fatal(ssh, r, "%s: parse cancel-streamlocal-forward@openssh.com", __func__); in server_input_global_request()
808 debug_f("cancel-streamlocal-forward path %s", in server_input_global_request()
812 } else if (strcmp(rtype, "no-more-sessions@openssh.com") == 0) { in server_input_global_request()
815 } else if (strcmp(rtype, "hostkeys-prove-00@openssh.com") == 0) { in server_input_global_request()
837 Channel *c; in server_input_channel_req()
848 debug("server_input_channel_req: channel %u request %s reply %d", in server_input_channel_req()
852 ssh_packet_disconnect(ssh, "%s: unknown channel %d", in server_input_channel_req()
859 } else if ((c->type == SSH_CHANNEL_LARVAL || in server_input_channel_req()
860 c->type == SSH_CHANNEL_OPEN) && strcmp(c->ctype, "session") == 0) in server_input_channel_req()
862 if (want_reply && !(c->flags & CHAN_CLOSE_SENT)) { in server_input_channel_req()
863 if (!c->have_remote_id) in server_input_channel_req()
864 fatal_f("channel %d: no remote_id", c->self); in server_input_channel_req()
867 (r = sshpkt_put_u32(ssh, c->remote_id)) != 0 || in server_input_channel_req()