Skip to content

dtls13: preserve app data after same-datagram KeyUpdate#122

Draft
zRedShift wants to merge 2 commits into
algesten:mainfrom
zRedShift:fix/dtls13-keyupdate-appdata-same-datagram
Draft

dtls13: preserve app data after same-datagram KeyUpdate#122
zRedShift wants to merge 2 commits into
algesten:mainfrom
zRedShift:fix/dtls13-keyupdate-appdata-same-datagram

Conversation

@zRedShift
Copy link
Copy Markdown
Contributor

Draft stacked on #121. Once #121 lands, this PR should be rebased onto main and its diff should collapse to the single DIMP-015 commit.

What

This preserves DTLS 1.3 application data that arrives in the same UDP datagram after a KeyUpdate request. The parser now defers post-KeyUpdate tails and replays them after installing the next read keys, while keeping malformed or over-capacity tails from committing replay-window state.

Why

Without this, a peer can send KeyUpdate followed by app data in the next epoch in one datagram, and dimpl discards or mishandles the tail instead of processing it under the updated keys.

Notes

Validation

  • git diff --check 1b56b2f..HEAD
  • cargo fmt --check
  • cargo test --test dtls13 key_update --features rcgen
  • cargo test --all-targets --features rcgen
  • cargo clippy --all-targets --features rcgen -- -D warnings

@zRedShift zRedShift force-pushed the fix/dtls13-keyupdate-appdata-same-datagram branch from 90989cf to a2ad7ad Compare May 24, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant