Fix to send record_overflow alert#10795
Open
embhorn wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a TLS protocol compliance issue where wolfSSL could terminate on an oversized TLS record without sending the required record_overflow alert, and adds API tests to validate the alert is emitted in both TLS 1.2 and TLS 1.3 scenarios (including post-handshake TLS 1.3 client behavior).
Changes:
- Always send a fatal
record_overflowalert whenGetRecordHeader()returnsLENGTH_ERROR(removes theHAVE_MAX_FRAGMENTguard). - Add
test_tls_record_overflow_alertto validate on-the-wire cleartext alerts pre-handshake and alert history for encrypted alerts post-handshake. - Register the new test in the API test list.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/api/test_tls.h | Adds prototype/registration for the new TLS record overflow alert test. |
| tests/api/test_tls.c | Adds test_tls_record_overflow_alert with TLS 1.2 + TLS 1.3 pre-handshake cleartext checks and TLS 1.3 post-handshake encrypted alert verification. |
| src/internal.c | Ensures record_overflow alert is sent on LENGTH_ERROR from record header parsing in all builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10795
Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
|
retest this please |
|
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
Removed the #ifdef HAVE_MAX_FRAGMENT guard so the alert is always sent, matching the unconditional record_overflow and the VERSION_ERROR alert directly above. Also corrected a pre-existing flush-left default: indentation in that block.
Fixes #10791
Testing
New test_tls_record_overflow_alert with three sub-cases that all exercise the fixed line:
Checklist