View | Details | Raw Unified | Return to bug 2521 | Differences between
and this patch

Collapse All | Expand All

(-)packet.c (-2 / +7 lines)
Lines 2237-2252 int Link Here
2237
ssh_packet_need_rekeying(struct ssh *ssh)
2237
ssh_packet_need_rekeying(struct ssh *ssh)
2238
{
2238
{
2239
	struct session_state *state = ssh->state;
2239
	struct session_state *state = ssh->state;
2240
	u_int32_t buf_in, buf_out;
2240
2241
2241
	if (ssh->compat & SSH_BUG_NOREKEY)
2242
	if (ssh->compat & SSH_BUG_NOREKEY)
2242
		return 0;
2243
		return 0;
2244
	buf_in = roundup(sshbuf_len(state->input),
2245
	    state->newkeys[MODE_IN]->enc.block_size);
2246
	buf_out = roundup(sshbuf_len(state->output),
2247
	    state->newkeys[MODE_OUT]->enc.block_size);
2243
	return
2248
	return
2244
	    (state->p_send.packets > MAX_PACKETS) ||
2249
	    (state->p_send.packets > MAX_PACKETS) ||
2245
	    (state->p_read.packets > MAX_PACKETS) ||
2250
	    (state->p_read.packets > MAX_PACKETS) ||
2246
	    (state->max_blocks_out &&
2251
	    (state->max_blocks_out &&
2247
	        (state->p_send.blocks > state->max_blocks_out)) ||
2252
	        (state->p_send.blocks + buf_out > state->max_blocks_out)) ||
2248
	    (state->max_blocks_in &&
2253
	    (state->max_blocks_in &&
2249
	        (state->p_read.blocks > state->max_blocks_in)) ||
2254
	        (state->p_read.blocks + buf_in > state->max_blocks_in)) ||
2250
	    (state->rekey_interval != 0 && state->rekey_time +
2255
	    (state->rekey_interval != 0 && state->rekey_time +
2251
		 state->rekey_interval <= monotime());
2256
		 state->rekey_interval <= monotime());
2252
}
2257
}

Return to bug 2521