diff options
author | Peter Wu <peter@lekensteyn.nl> | 2019-01-25 14:05:24 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2019-01-27 09:47:54 +0000 |
commit | 1527177cb97071e78b186d70e89dc83ea7b7cd55 (patch) | |
tree | 5f2fa32f41f185f18e858fd90bbf5489ebf0bf62 /test | |
parent | 596f538b5bfa2f1b8ec4b3fef839008adb236156 (diff) |
TCP: pass data after a ZeroWindowProbe to subdissectors
If the single byte within a ZeroWindowProbe triggers reassembly within a
subdissector, a new MSP will be created with just a single byte. Be sure
not to mark subsequent segments that contain the full segment data as
retransmission as this prevents the subdissector from seeing the data.
Bug: 15427
Change-Id: I36ae2622689c6606c99cdff70b6beba4b9d25ca7
Reviewed-on: https://code.wireshark.org/review/31732
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jasper Bongertz <jasper@packet-foo.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'test')
-rw-r--r-- | test/captures/retrans-tls.pcap | bin | 0 -> 158 bytes | |||
-rw-r--r-- | test/suite_dissection.py | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/captures/retrans-tls.pcap b/test/captures/retrans-tls.pcap Binary files differnew file mode 100644 index 0000000000..90be0de74b --- /dev/null +++ b/test/captures/retrans-tls.pcap diff --git a/test/suite_dissection.py b/test/suite_dissection.py index 9af19ec2cd..9a62e933cc 100644 --- a/test/suite_dissection.py +++ b/test/suite_dissection.py @@ -121,3 +121,28 @@ class case_dissect_tcp(subprocesstest.SubprocessTestCase): # H - second retransmission. self.assertIn('7\t\t', lines[6]) self.assertNotIn('[TCP segment of a reassembled PDU]', lines[6]) + + def test_tcp_reassembly_more_data_1(self, cmd_tshark, capture_file): + ''' + Tests that reassembly also works when a new packet begins at the same + sequence number as the initial segment. This models behavior with the + ZeroWindowProbe: the initial segment contains a single byte. The second + segment contains that byte, plus the remainder. + ''' + proc = self.assertRun((cmd_tshark, + '-r', capture_file('retrans-tls.pcap'), + '-Ytls', '-Tfields', '-eframe.number', '-etls.record.length',)) + output = proc.stdout_str.replace('\r', '') + # First pass dissection actually accepted the first frame as TLS, but + # subsequently requested reassembly. + self.assertEqual(output, '1\t\n2\t16\n') + + def test_tcp_reassembly_more_data_2(self, cmd_tshark, capture_file): + ''' + Like test_tcp_reassembly_more_data_1, but checks the second pass (-2). + ''' + proc = self.assertRun((cmd_tshark, + '-r', capture_file('retrans-tls.pcap'), + '-Ytls', '-Tfields', '-eframe.number', '-etls.record.length', '-2')) + output = proc.stdout_str.replace('\r', '') + self.assertEqual(output, '2\t16\n') |