Fixes found when trying a new static analysis method#9786
Merged
dgarske merged 4 commits intowolfSSL:masterfrom Feb 17, 2026
Merged
Fixes found when trying a new static analysis method#9786dgarske merged 4 commits intowolfSSL:masterfrom
dgarske merged 4 commits intowolfSSL:masterfrom
Conversation
The while loop conditions in TLSX_TCA_Find were inverted, causing two bugs: the loop short-circuited on type match alone without checking the id content, and the XMEMCMP sense was reversed (continuing on match, stopping on mismatch). This meant any TCA entry with a matching type would be returned as a match regardless of whether the identifier actually matched. Restructure the loop to correctly require both type and id (size + content) to match before returning an entry, and to match any entry immediately for PRE_AGREED type. Add test_TLSX_TCA_Find unit test exercising exact match, mismatched id, and PRE_AGREED cases via memio handshake.
DTLS13_FIXED_BITS_MASK used 0x111 (hex 273) instead of 0x7 (decimal 7, binary 111). Per RFC 9147 Section 4, the top 3 bits of the unified header flags byte must be 001. The incorrect hex value caused the mask to only check bit 5 instead of bits 5, 6, and 7, allowing bytes with bits 6 or 7 set to be misidentified as unified DTLS 1.3 headers.
dgarske
approved these changes
Feb 17, 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.
Fix DTLS 1.3 unified header fixed bits mask
DTLS13_FIXED_BITS_MASK used 0x111 (hex 273) instead of 0x7 (decimal 7, binary 111). Per RFC 9147 Section 4, the top 3 bits of the unified header flags byte must be 001. The incorrect hex value caused the mask to only check bit 5 instead of bits 5, 6, and 7, allowing bytes with bits 6 or 7 set to be misidentified as unified DTLS 1.3 headers.
Use XMEMSET instead of memset in QUIC
Fix logic bug in TLSX_TCA_Find causing incorrect Trusted CA matching
The while loop conditions in TLSX_TCA_Find were inverted, causing two bugs: the loop short-circuited on type match alone without checking the id content, and the XMEMCMP sense was reversed (continuing on match, stopping on mismatch). This meant any TCA entry with a matching type would be returned as a match regardless of whether the identifier actually matched.