TLS-Attacker icon indicating copy to clipboard operation
TLS-Attacker copied to clipboard

[AI] Fix #78: Add TCP segmentation support for TLS records

Open ic0ns opened this issue 10 months ago • 0 comments

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 TcpSegmentConfiguration class to define how records should be segmented
  • Modified Record class to include optional TCP segmentation configuration
  • Updated RecordLayer to 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

ic0ns avatar Jun 26 '25 19:06 ic0ns