Skip to content

dtls: defer replay commits until datagram parse succeeds#121

Open
zRedShift wants to merge 1 commit into
algesten:mainfrom
zRedShift:fix/dtls-replay-atomic-datagram
Open

dtls: defer replay commits until datagram parse succeeds#121
zRedShift wants to merge 1 commit into
algesten:mainfrom
zRedShift:fix/dtls-replay-atomic-datagram

Conversation

@zRedShift
Copy link
Copy Markdown
Contributor

Summary

  • defer DTLS 1.2 and DTLS 1.3 replay-window commits until the full datagram parses successfully
  • keep datagram-local replay/sequence state so same-datagram duplicates and stale records are still rejected before the permanent replay update
  • add DTLS 1.2 and DTLS 1.3 regressions for malformed trailing records, duplicate encrypted records, and same-datagram window shifts

Validation

  • git diff --check upstream/main..HEAD
  • cargo fmt --manifest-path ../Cargo.toml --check
  • cargo test --manifest-path ../Cargo.toml --all-targets --features rcgen
  • cargo clippy --manifest-path ../Cargo.toml --all-targets --features rcgen -- -D warnings

Review

  • adversarial review found no branch-blocking findings
  • residual same-record malformed handshake-tail parsing is tracked separately as DIMP-029

@zRedShift zRedShift force-pushed the fix/dtls-replay-atomic-datagram branch from 1b56b2f to 9027afa Compare May 25, 2026 13:08
@algesten
Copy link
Copy Markdown
Owner

@zRedShift I'm not sure about this one. I don't think anything in the specs says that there needs to be an all-or-nothing handling of UDP packets. A packet with valid records first and then trailing garbage, could be partially handled.

It ties into the bigger question of is_transient() error that we started looking at in #126. It could be we should simply silently drop records when they don't parse correctly.

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.

2 participants