| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: clientloop.c,v 1.12 2015/04/03 23:58:19 christos Exp $ */ | | 1 | /* $NetBSD: clientloop.c,v 1.13 2015/04/13 17:59:21 christos Exp $ */ |
2 | /* $OpenBSD: clientloop.c,v 1.272 2015/02/25 19:54:02 djm Exp $ */ | | 2 | /* $OpenBSD: clientloop.c,v 1.272 2015/02/25 19:54:02 djm Exp $ */ |
3 | /* | | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
5 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | | 5 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
6 | * All rights reserved | | 6 | * All rights reserved |
7 | * The main loop for the interactive session (client side). | | 7 | * The main loop for the interactive session (client side). |
8 | * | | 8 | * |
9 | * As far as I am concerned, the code I have written for this software | | 9 | * As far as I am concerned, the code I have written for this software |
10 | * can be used freely for any purpose. Any derived versions of this | | 10 | * can be used freely for any purpose. Any derived versions of this |
11 | * software must be clearly marked as such, and if the derived work is | | 11 | * software must be clearly marked as such, and if the derived work is |
12 | * incompatible with the protocol description in the RFC file, it must be | | 12 | * incompatible with the protocol description in the RFC file, it must be |
13 | * called by a name other than "ssh" or "Secure Shell". | | 13 | * called by a name other than "ssh" or "Secure Shell". |
14 | * | | 14 | * |
| @@ -51,27 +51,27 @@ | | | @@ -51,27 +51,27 @@ |
51 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | | 51 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
52 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 52 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
53 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 53 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
54 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 54 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
55 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 55 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
56 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 56 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
57 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 57 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
58 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 58 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
59 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 59 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
60 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 60 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
61 | */ | | 61 | */ |
62 | | | 62 | |
63 | #include "includes.h" | | 63 | #include "includes.h" |
64 | __RCSID("$NetBSD: clientloop.c,v 1.12 2015/04/03 23:58:19 christos Exp $"); | | 64 | __RCSID("$NetBSD: clientloop.c,v 1.13 2015/04/13 17:59:21 christos Exp $"); |
65 | | | 65 | |
66 | #include <sys/param.h> /* MIN MAX */ | | 66 | #include <sys/param.h> /* MIN MAX */ |
67 | #include <sys/types.h> | | 67 | #include <sys/types.h> |
68 | #include <sys/ioctl.h> | | 68 | #include <sys/ioctl.h> |
69 | #include <sys/stat.h> | | 69 | #include <sys/stat.h> |
70 | #include <sys/socket.h> | | 70 | #include <sys/socket.h> |
71 | #include <sys/time.h> | | 71 | #include <sys/time.h> |
72 | #include <sys/queue.h> | | 72 | #include <sys/queue.h> |
73 | | | 73 | |
74 | #include <ctype.h> | | 74 | #include <ctype.h> |
75 | #include <errno.h> | | 75 | #include <errno.h> |
76 | #include <paths.h> | | 76 | #include <paths.h> |
77 | #include <signal.h> | | 77 | #include <signal.h> |
| @@ -1584,27 +1584,28 @@ client_loop(int have_pty, int escape_cha | | | @@ -1584,27 +1584,28 @@ client_loop(int have_pty, int escape_cha |
1584 | */ | | 1584 | */ |
1585 | max_fd2 = max_fd; | | 1585 | max_fd2 = max_fd; |
1586 | client_wait_until_can_do_something(&readset, &writeset, | | 1586 | client_wait_until_can_do_something(&readset, &writeset, |
1587 | &max_fd2, &nalloc, rekeying); | | 1587 | &max_fd2, &nalloc, rekeying); |
1588 | | | 1588 | |
1589 | if (quit_pending) | | 1589 | if (quit_pending) |
1590 | break; | | 1590 | break; |
1591 | | | 1591 | |
1592 | /* Do channel operations unless rekeying in progress. */ | | 1592 | /* Do channel operations unless rekeying in progress. */ |
1593 | if (!rekeying) { | | 1593 | if (!rekeying) { |
1594 | channel_after_select(readset, writeset); | | 1594 | channel_after_select(readset, writeset); |
1595 | if (need_rekeying || packet_need_rekeying()) { | | 1595 | if (need_rekeying || packet_need_rekeying()) { |
1596 | debug("need rekeying"); | | 1596 | debug("need rekeying"); |
1597 | active_state->kex->done = 0; | | 1597 | if (active_state->kex != NULL) |
| | | 1598 | active_state->kex->done = 0; |
1598 | if ((r = kex_send_kexinit(active_state)) != 0) | | 1599 | if ((r = kex_send_kexinit(active_state)) != 0) |
1599 | fatal("%s: kex_send_kexinit: %s", | | 1600 | fatal("%s: kex_send_kexinit: %s", |
1600 | __func__, ssh_err(r)); | | 1601 | __func__, ssh_err(r)); |
1601 | need_rekeying = 0; | | 1602 | need_rekeying = 0; |
1602 | } | | 1603 | } |
1603 | } | | 1604 | } |
1604 | | | 1605 | |
1605 | /* Buffer input from the connection. */ | | 1606 | /* Buffer input from the connection. */ |
1606 | client_process_net_input(readset); | | 1607 | client_process_net_input(readset); |
1607 | | | 1608 | |
1608 | if (quit_pending) | | 1609 | if (quit_pending) |
1609 | break; | | 1610 | break; |
1610 | | | 1611 | |