summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/clientloop.c b/clientloop.c
index f0a08f234..9820455c4 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.283 2016/02/01 21:18:17 millert Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.284 2016/02/08 10:57:07 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1502,7 +1502,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1502{ 1502{
1503 fd_set *readset = NULL, *writeset = NULL; 1503 fd_set *readset = NULL, *writeset = NULL;
1504 double start_time, total_time; 1504 double start_time, total_time;
1505 int r, max_fd = 0, max_fd2 = 0, len, rekeying = 0; 1505 int r, max_fd = 0, max_fd2 = 0, len;
1506 u_int64_t ibytes, obytes; 1506 u_int64_t ibytes, obytes;
1507 u_int nalloc = 0; 1507 u_int nalloc = 0;
1508 char buf[100]; 1508 char buf[100];
@@ -1617,10 +1617,15 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1617 if (compat20 && session_closed && !channel_still_open()) 1617 if (compat20 && session_closed && !channel_still_open())
1618 break; 1618 break;
1619 1619
1620 rekeying = (active_state->kex != NULL && !active_state->kex->done); 1620 if (ssh_packet_is_rekeying(active_state)) {
1621
1622 if (rekeying) {
1623 debug("rekeying in progress"); 1621 debug("rekeying in progress");
1622 } else if (need_rekeying) {
1623 /* manual rekey request */
1624 debug("need rekeying");
1625 if ((r = kex_start_rekex(active_state)) != 0)
1626 fatal("%s: kex_start_rekex: %s", __func__,
1627 ssh_err(r));
1628 need_rekeying = 0;
1624 } else { 1629 } else {
1625 /* 1630 /*
1626 * Make packets of buffered stdin data, and buffer 1631 * Make packets of buffered stdin data, and buffer
@@ -1651,23 +1656,14 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1651 */ 1656 */
1652 max_fd2 = max_fd; 1657 max_fd2 = max_fd;
1653 client_wait_until_can_do_something(&readset, &writeset, 1658 client_wait_until_can_do_something(&readset, &writeset,
1654 &max_fd2, &nalloc, rekeying); 1659 &max_fd2, &nalloc, ssh_packet_is_rekeying(active_state));
1655 1660
1656 if (quit_pending) 1661 if (quit_pending)
1657 break; 1662 break;
1658 1663
1659 /* Do channel operations unless rekeying in progress. */ 1664 /* Do channel operations unless rekeying in progress. */
1660 if (!rekeying) { 1665 if (!ssh_packet_is_rekeying(active_state))
1661 channel_after_select(readset, writeset); 1666 channel_after_select(readset, writeset);
1662 if (need_rekeying || packet_need_rekeying()) {
1663 debug("need rekeying");
1664 active_state->kex->done = 0;
1665 if ((r = kex_send_kexinit(active_state)) != 0)
1666 fatal("%s: kex_send_kexinit: %s",
1667 __func__, ssh_err(r));
1668 need_rekeying = 0;
1669 }
1670 }
1671 1667
1672 /* Buffer input from the connection. */ 1668 /* Buffer input from the connection. */
1673 client_process_net_input(readset); 1669 client_process_net_input(readset);