Skip to content

Add PreSharedKey extensions for DTLS 1.3#773

Merged
theodorsm merged 9 commits intomasterfrom
theodorsm/psk-ext
Jan 22, 2026
Merged

Add PreSharedKey extensions for DTLS 1.3#773
theodorsm merged 9 commits intomasterfrom
theodorsm/psk-ext

Conversation

@theodorsm
Copy link
Copy Markdown
Member

@theodorsm theodorsm commented Jan 13, 2026

Description

DTLS 1.3 uses two new extensions to negotiate PreSharedKey (PSK) mode.

Progress:

  • pre_shared_key extension
  • pre_shared_key tests and fuzz
  • psk_exchange_modes extension
  • psk_exchange_modes tests and fuzz

Reference issue

Fixes #771

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 75.55556% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.60%. Comparing base (01f7ba5) to head (31e16aa).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/protocol/extension/pre_shared_key.go 73.77% 8 Missing and 8 partials ⚠️
pkg/protocol/extension/psk_key_exchange_modes.go 79.31% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #773      +/-   ##
==========================================
- Coverage   81.70%   81.60%   -0.10%     
==========================================
  Files         105      107       +2     
  Lines        5847     5937      +90     
==========================================
+ Hits         4777     4845      +68     
- Misses        688      699      +11     
- Partials      382      393      +11     
Flag Coverage Δ
go 81.60% <75.55%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@theodorsm theodorsm force-pushed the theodorsm/psk-ext branch 2 times, most recently from a9b8265 to 062070a Compare January 20, 2026 13:40
@theodorsm theodorsm marked this pull request as ready for review January 20, 2026 13:55
Copy link
Copy Markdown
Contributor

@adrianosela adrianosela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Pointed out some minor validation checks missing in (p *PreSharedKey) Unmarshal, as well as some nice-to-have documentation.

@theodorsm
Copy link
Copy Markdown
Member Author

theodorsm commented Jan 21, 2026

@adrianosela, thanks for the review! I have fixed your comments, it's ready for another round 👀 I added a couple extra tests for multiple identites and the 1:1 match with binders.

@theodorsm theodorsm requested a review from adrianosela January 21, 2026 18:31
Copy link
Copy Markdown
Contributor

@adrianosela adrianosela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 comments left, LGTM.

Copy link
Copy Markdown
Member

@JoTurk JoTurk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the comment lgtm :)

@theodorsm theodorsm merged commit bed33fe into master Jan 22, 2026
20 checks passed
@theodorsm theodorsm deleted the theodorsm/psk-ext branch January 22, 2026 12:14
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.

DTLS 1.3 PSK extensions

3 participants