diff options
author | Colin Watson <cjwatson@debian.org> | 2019-06-05 06:41:44 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2019-06-05 06:41:44 +0100 |
commit | 102062f825fb26a74295a1c089c00c4c4c76b68a (patch) | |
tree | 3db66bc8c8483cce66516dff36f6ef56065143d9 /mux.c | |
parent | 3d246f10429fc9a37b98eabef94fe8dc7c61002b (diff) | |
parent | fd0fa130ecf06d7d092932adcd5d77f1549bfc8d (diff) |
Import openssh_8.0p1.orig.tar.gz
Diffstat (limited to 'mux.c')
-rw-r--r-- | mux.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mux.c,v 1.77 2018/09/26 07:32:44 djm Exp $ */ | 1 | /* $OpenBSD: mux.c,v 1.79 2019/01/19 21:35:25 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -610,6 +610,7 @@ mux_confirm_remote_forward(struct ssh *ssh, int type, u_int32_t seq, void *ctxt) | |||
610 | struct Forward *rfwd; | 610 | struct Forward *rfwd; |
611 | Channel *c; | 611 | Channel *c; |
612 | struct sshbuf *out; | 612 | struct sshbuf *out; |
613 | u_int port; | ||
613 | int r; | 614 | int r; |
614 | 615 | ||
615 | if ((c = channel_by_id(ssh, fctx->cid)) == NULL) { | 616 | if ((c = channel_by_id(ssh, fctx->cid)) == NULL) { |
@@ -632,7 +633,15 @@ mux_confirm_remote_forward(struct ssh *ssh, int type, u_int32_t seq, void *ctxt) | |||
632 | rfwd->connect_host, rfwd->connect_port); | 633 | rfwd->connect_host, rfwd->connect_port); |
633 | if (type == SSH2_MSG_REQUEST_SUCCESS) { | 634 | if (type == SSH2_MSG_REQUEST_SUCCESS) { |
634 | if (rfwd->listen_port == 0) { | 635 | if (rfwd->listen_port == 0) { |
635 | rfwd->allocated_port = packet_get_int(); | 636 | if ((r = sshpkt_get_u32(ssh, &port)) != 0) |
637 | fatal("%s: packet error: %s", | ||
638 | __func__, ssh_err(r)); | ||
639 | if (port > 65535) { | ||
640 | fatal("Invalid allocated port %u for " | ||
641 | "mux remote forward to %s:%d", port, | ||
642 | rfwd->connect_host, rfwd->connect_port); | ||
643 | } | ||
644 | rfwd->allocated_port = (int)port; | ||
636 | debug("Allocated port %u for mux remote forward" | 645 | debug("Allocated port %u for mux remote forward" |
637 | " to %s:%d", rfwd->allocated_port, | 646 | " to %s:%d", rfwd->allocated_port, |
638 | rfwd->connect_host, rfwd->connect_port); | 647 | rfwd->connect_host, rfwd->connect_port); |
@@ -1406,7 +1415,8 @@ mux_session_confirm(struct ssh *ssh, int id, int success, void *arg) | |||
1406 | if (cctx->want_agent_fwd && options.forward_agent) { | 1415 | if (cctx->want_agent_fwd && options.forward_agent) { |
1407 | debug("Requesting authentication agent forwarding."); | 1416 | debug("Requesting authentication agent forwarding."); |
1408 | channel_request_start(ssh, id, "auth-agent-req@openssh.com", 0); | 1417 | channel_request_start(ssh, id, "auth-agent-req@openssh.com", 0); |
1409 | packet_send(); | 1418 | if ((r = sshpkt_send(ssh)) != 0) |
1419 | fatal("%s: packet error: %s", __func__, ssh_err(r)); | ||
1410 | } | 1420 | } |
1411 | 1421 | ||
1412 | client_session2_setup(ssh, id, cctx->want_tty, cctx->want_subsys, | 1422 | client_session2_setup(ssh, id, cctx->want_tty, cctx->want_subsys, |