TLS-Attacker
TLS-Attacker copied to clipboard
[AI] Fix #78: Add TCP segmentation support for TLS records
Summary
This PR implements TCP segmentation support for TLS records, allowing fine-grained control over how records are split across TCP segments. This addresses issue #78.
Changes
- Added
TcpSegmentConfigurationclass to define how records should be segmented - Modified
Recordclass to include optional TCP segmentation configuration - Updated
RecordLayerto handle TCP segmentation when sending records - Added comprehensive unit tests for the segmentation functionality
- Created documentation and example workflow
Features
- Split TLS records at arbitrary byte offsets
- Configure delays between TCP segments
- Full XML serialization support for workflow traces
- Works with all existing TLS-Attacker features
Usage Example
<Record>
<tcpSegmentation>
<segment>
<offset>0</offset>
<length>3</length>
</segment>
<segment>
<offset>3</offset>
</segment>
<segmentDelay>10</segmentDelay>
</tcpSegmentation>
</Record>
This example splits the record header, sending the first 3 bytes (ContentType + Version) in one TCP segment and the rest in another segment, with a 10ms delay between them.
Test Plan
- [x] Unit tests for TCP segmentation configuration
- [x] Tests verify XML serialization/deserialization
- [x] Build passes with
mvn clean compile - [x] All tests pass
- [x] Code formatted with spotless
Fixes #78