dtlsv13: fix: send correct CH2 when server do not send HRR#10730
Open
rizlik wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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 onserverState(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.
Frauschi
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Wolfssl wrongly discriminate between CH1 and CH2 by the Cookie looking at cookie extension, that is optional in HRR.
ZD#22000