Repository navigation
Don't back off on a DTLS 1.3 quick timeout that sends ACKs - #12143
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the DTLS 1.3 quick-timeout handling fix.
No open issues 🎉
What changed in this PR
Fixes DTLS 1.3 quick-timeout handling so sending pending ACKs with nothing to retransmit does not increase the timeout or prematurely fail an ongoing handshake.
Changes:
- Preserves the quick-timeout state before sending ACKs and skips backoff when the retransmission queue is empty.
- Retains existing behavior for buffered retransmissions and full timeouts.
- Adds regression coverage for normal and maximum timeout values, subsequent full-timeout backoff, and handshake completion.
| File | Description |
|---|---|
tests/api/test_dtls.h |
Declares and registers the new regression test. |
tests/api/test_dtls.c |
Tests quick-timeout handling during a partially received client flight. |
src/dtls13.c |
Skips backoff for quick timeouts with no buffered retransmissions. |
Review effort: Balanced
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12143
Scan targets checked: wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): tests/api/test_dtls.h
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
|
Jenkins retest this please |
julek-wolfssl
left a comment
There was a problem hiding this comment.
It looks to me that removing the clearing of ssl->dtls13FastTimeout before SendDtls13Ack is the correct way to handle this instead of the current changes.
Dtls13RtxTimeout cleared dtls13FastTimeout before sending the pending ACKs and only then checked the flag to decide whether this was the quick timeout. Whenever ACKs could be sent, the quick timeout took the long timeout path and doubled the retransmission timeout. While a peer flight arrives in parts, each quick timeout doubled it with nothing lost on our side, and with a low maximum the quick timeout could fail the handshake while the peer was still sending. Leave the flag set while sending the ACKs, so a quick timeout only sends ACKs, as it already did when there was nothing to ACK. The next full timeout retransmits and backs off.
07216e1 to
ccb05d6
Compare
|
Agreed, that's simpler. Removed the clear instead of the snapshot and early return, so a quick timeout only sends ACKs and the next full timeout retransmits and backs off. The new test passes unchanged. |
Description
Dtls13RtxTimeoutcleareddtls13FastTimeoutwhile sending the pending ACKs and only then checked it, so a quick timeout with ACKs to send took the long-timeout path. While a peer flight arrives in parts, nothing of ours is buffered, so the quick timeout doubled the timeout without retransmitting anything, on top of the doubling at the next full timeout; RFC 9147 5.8.2 doubles only at a retransmission. With a maximum close to the initial timeout, the quick timeout failed the handshake while the peer was still sending.Changes
Dtls13RtxTimeoutno longer clearsdtls13FastTimeoutbefore sending ACKs, so a quick timeout only sends ACKs.Testing
test_dtls13_quick_timeout_no_backoff: a quick timeout on a partly received client flight sends one ACK and keeps the timeout, the next full timeout backs off, and with the timeout already at its maximum the quick timeout succeeds and the handshake completes. Fails on master.