summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2016-01-29 03:31:03 +0000
committerDamien Miller <djm@mindrot.org>2016-01-30 11:19:14 +1100
commit6fd6e28daccafaa35f02741036abe64534c361a1 (patch)
tree748a609f73b404de6378cc9104481c4d86322ef0
parent921ff00b0ac429666fb361d2d6cb1c8fff0006cb (diff)
upstream commit
Revert "account for packets buffered but not yet processed" change as it breaks for very small RekeyLimit values due to continuous rekeying. ok djm@ Upstream-ID: 7e03f636cb45ab60db18850236ccf19079182a19
-rw-r--r--packet.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/packet.c b/packet.c
index f61b32b80..216b06bc7 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.224 2016/01/29 02:54:45 dtucker Exp $ */ 1/* $OpenBSD: packet.c,v 1.225 2016/01/29 03:31:03 dtucker 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
@@ -2254,21 +2254,16 @@ int
2254ssh_packet_need_rekeying(struct ssh *ssh) 2254ssh_packet_need_rekeying(struct ssh *ssh)
2255{ 2255{
2256 struct session_state *state = ssh->state; 2256 struct session_state *state = ssh->state;
2257 u_int32_t buf_in, buf_out;
2258 2257
2259 if (ssh->compat & SSH_BUG_NOREKEY) 2258 if (ssh->compat & SSH_BUG_NOREKEY)
2260 return 0; 2259 return 0;
2261 buf_in = roundup(sshbuf_len(state->input),
2262 state->newkeys[MODE_IN]->enc.block_size);
2263 buf_out = roundup(sshbuf_len(state->output),
2264 state->newkeys[MODE_OUT]->enc.block_size);
2265 return 2260 return
2266 (state->p_send.packets > MAX_PACKETS) || 2261 (state->p_send.packets > MAX_PACKETS) ||
2267 (state->p_read.packets > MAX_PACKETS) || 2262 (state->p_read.packets > MAX_PACKETS) ||
2268 (state->max_blocks_out && 2263 (state->max_blocks_out &&
2269 (state->p_send.blocks + buf_out > state->max_blocks_out)) || 2264 (state->p_send.blocks > state->max_blocks_out)) ||
2270 (state->max_blocks_in && 2265 (state->max_blocks_in &&
2271 (state->p_read.blocks + buf_in > state->max_blocks_in)) || 2266 (state->p_read.blocks > state->max_blocks_in)) ||
2272 (state->rekey_interval != 0 && state->rekey_time + 2267 (state->rekey_interval != 0 && state->rekey_time +
2273 state->rekey_interval <= monotime()); 2268 state->rekey_interval <= monotime());
2274} 2269}