Skip to content

Fixes found when trying a new static analysis method#9786

Merged
dgarske merged 4 commits intowolfSSL:masterfrom
LinuxJedi:quick-fixes
Feb 17, 2026
Merged

Fixes found when trying a new static analysis method#9786
dgarske merged 4 commits intowolfSSL:masterfrom
LinuxJedi:quick-fixes

Conversation

@LinuxJedi
Copy link
Copy Markdown
Member

@LinuxJedi LinuxJedi commented Feb 17, 2026

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.

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 dgarske merged commit 03260bf into wolfSSL:master Feb 17, 2026
434 of 435 checks passed
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.

3 participants