Repository navigation
feat(foundation): reassemble TLS records split across TCP segments (#2938) - #3138
Conversation
Documentation build overview
138 files changed ·
|
|
Review verdict: needs changes at
Confirmed:
For whichever of #3137 and this PR lands second: pick one order for the |
1a777e2 to
ed1e6fe
Compare
ed1e6fe to
61a31fc
Compare
|
Re-review verdict: good to go at
For whichever of this PR and #3137 lands second: reconcile the |
|
Coverage: 94.81% (unit tier, Python 3.15,
Per-file detail: the |
|
Ready to merge at |
|
Resolve conflicts |
|
On it: the original worker is already rebasing this onto |
…2938) - add pcapkit.foundation.reassembly.tls.TLS, registered as 'tls': each TCP direction is one octet stream, followed from its SYN or from a segment whose payload opens a record header, and cut into records by their headers (RFC 9846 section 5.1); out-of-order octets wait and the first received win (RFC 9293 sections 3.4 and 3.10); a FIN or RST closes it - report every record of the stream, COMPLETE, or PARTIAL/TIMEOUT with no packet when a hole or the stream's end cuts it - add TLS.record_header and TLS.analyze_record, and the public wrapper pcapkit.foundation.analysis.tls.tls_record - refuse a TLS or legacy DTLS record declaring more than 2^14 + 2048 octets (RFC 5246 section 6.2.3), and a DTLS 1.3 unified-header one more than 2^14 + 256 (RFC 9147 section 4), in parse and make, first or further - add tls_reassembly adapters for pcap, pcapng, dpkt, scapy and pypcapfile, keeping the TCP adapter's record of a segment on a port TCP binds to TLS - add ReassemblyData.tls; Deferred admits the TLS record header - move TCP reassembly's _unwrap to pcapkit.utilities.seqnum.unwrap, which both reassemblers read - document the reassembler, its analysis and the toolkit adapters Tests: new TLS reassembly and seqnum tests fail on origin/develop; tests/project, tests/foundation, tests/toolkit, tests/protocols/application pass.
61a31fc to
8e9cbf3
Compare
|
Rebased
|
|
Re-review verdict: good to go at
|
Please follow the guide below
Put an
xinto every box [ ] that applies to your pull request (like this: [x])Use the Preview tab to see how your pull request will look
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeDescribed the user-visible change below and left its changelog entry to the maintainer, keeping
docs/source/changelog/andCHANGELOG.mdout of the diff, if the change is user-visible: N/A — centralisedWhat is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseAlso tick if it regenerates constant or registry tables, members keeping their numeric values (the
constlabel)Description of your pull request and other information
Closes #2938.
flowchart TD SEG["a TCP segment on a port TCP binds to TLS"] -->|"toolkit <engine>.tls_reassembly: TCP adapter's record"| RE["reassembly.tls.TLS: one octet stream per direction"] RE -->|"TLS.record_header (RFC 9846 §5.1)"| REC["every record, COMPLETE or PARTIAL/TIMEOUT"] REC -->|"packet, deferred: TLS.analyze_record"| PKT["TLS layer, hello extensions decoded"]reassembly=['tls']on pcap, pcapng, dpkt, scapy and pypcapfile;ReassemblyData.tls;analysis.tls_record. A stream starts at its SYN, or at a segment whose payload opens a record header; out-of-order octets wait, the first received win (RFC 9293 §3.4, §3.10); FIN/RST close it.packet=None, as DTLS's do._unwrapmoves topcapkit.utilities.seqnum.unwrap, now that TLS reads it too.test_tls_record_reassembly_2938_unitandtest_seqnum_2938_unitfail on an untouchedorigin/developexport; pins moved for the newtlsbuilt-in field and toolkit__all__.