Skip to content

dtlsv13: fix: send correct CH2 when server do not send HRR#10730

Open
rizlik wants to merge 1 commit into
wolfSSL:masterfrom
rizlik:dtlsv13_interop
Open

dtlsv13: fix: send correct CH2 when server do not send HRR#10730
rizlik wants to merge 1 commit into
wolfSSL:masterfrom
rizlik:dtlsv13_interop

Conversation

@rizlik

@rizlik rizlik commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Description

Wolfssl wrongly discriminate between CH1 and CH2 by the Cookie looking at cookie extension, that is optional in HRR.

ZD#22000

Copilot AI review requested due to automatic review settings June 18, 2026 11:46
@rizlik rizlik self-assigned this Jun 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes DTLS 1.3 ClientHello (CH1 vs CH2) handling when the server sends a HelloRetryRequest (HRR) without the (optional) cookie extension, ensuring the client sends the correct CH2 key_share (and allows CH2 fragmentation) instead of mistakenly treating it like CH1.

Changes:

  • Update SendTls13ClientHello() to decide “CH1 vs CH2” based on serverState (HRR completion) rather than presence of the cookie extension.
  • Add a DTLS 1.3 API test that disables HRR cookies on the server and verifies CH2 still carries the real (large) PQ key share and can fragment.
  • Register the new test in the DTLS 1.3 API test group.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/api/test_dtls13.h Adds prototype and registers the new DTLS 1.3 fragmentation/no-cookie test.
tests/api/test_dtls13.c Implements test_dtls13_frag_ch_pq_no_cookie() to cover HRR without cookie extension.
src/tls13.c Fixes CH1/CH2 discrimination for DTLS CH fragmentation logic by using HRR state instead of cookie extension presence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rizlik rizlik requested a review from Frauschi June 18, 2026 14:43
@rizlik rizlik assigned Frauschi and unassigned rizlik Jun 18, 2026
@rizlik rizlik assigned wolfSSL-Bot and unassigned Frauschi Jun 18, 2026
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.

4 participants