fix(proto): require exact echo reply packet length

This commit is contained in:
Nils Andreas Svee committed 2026-05-10 20:56:43 +07:00
1 parent ef18bb549c
commit 48f6cb80ed
4 files changed
+265 -6

No files matched your search

+3 -1
View File
@@ -707,7 +707,9 @@ fn instant_abs_diff(left: Instant, right: Instant) -> Duration {
fn recv_buffer_size(has_hmac: bool, negotiated: Option<&NegotiatedParams>) -> usize {
match negotiated {
Some(negotiated) => echo_packet_len(has_hmac, &negotiated.params).max(MIN_RECV_BUFFER_SIZE),
Some(negotiated) => echo_packet_len(has_hmac, &negotiated.params)
.saturating_add(1)
.max(MIN_RECV_BUFFER_SIZE),
None => MIN_RECV_BUFFER_SIZE,
}
}