wireshark/test/captures
Aurelien Aptel 0db39ae59a smb2: add support for decompression
The latest iteration of Microsoft updates to SMB3 added compression to
the protocol. This commit implements decompressing and dissecting
compressed payloads.

The compression algorithms that can be used are "Plain LZ77",
"LZ77+Huffman" and "LZNT1" which you can read more about in the
[MS-XCA] documentation. This set of algorithm is sometimes referred to
as XPRESS.

This commit reuses the existing uncompression API scheme already in
place with zlib and brotli and adds 3 tvb_uncompress_*() function
implemented in:
* epan/tvbuff_lz77.c
* epan/tvbuff_lz77huff.c
* epan/tvbuff_lznt1.c

A new function wmem_array_try_index() was added to the wmem_array API
to make bound checked reads that fail gracefully. New tests for it
have been added as well.

Since both reads (tvb) and writes (wmem_array) are bound checked the
risk for buffer overruns is drastically reduced. LZ77+Huffman has
decoding tables and special care was taken to bound check these.

Simplified versions of the implementations were succesfully tested
against AFL (American Fuzzy Lop) for ~150 millions executions each.

The SMB2/3 dissector was changed to deal with the new transform header
for compressed packets (new protocol_id value) and READ request
flags (COMPRESSED). Badly compressed or encrypted packets are now
reported as such, and the decryption test suite was changed to reflect
that.

This commit also adds a test capture with 1 packet compressed with
each algorithm as returned by Windows Server 2019, along with 3
matching tests in test/suite_dissection.py

Change-Id: I2b84f56541f2f4ee7d886152794b993987dd10e7
Reviewed-on: https://code.wireshark.org/review/33855
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-07-15 21:00:14 +00:00
..
arp.pcap
c1222_std_example8.pcap
dhcp-nanosecond.pcap
dhcp-nanosecond.pcapng
dhcp.pcap
dhcp.pcapng
dhe1.pcapng.gz
dmgr.pcapng
dns+icmp.pcapng.gz
dns-ooo.pcap tcp: fix OoO reassembly when the first data packet is OoO 2018-08-30 04:07:01 +00:00
dns_port.pcap
dtls12-aes128ccm8-dsb.pcapng DTLS: add DSB support, use the key log file from the TLS dissector 2019-01-17 21:33:25 +00:00
dtls12-aes128ccm8.pcap
dvb-ci_UV1_0000.pcap
empty.pcap
esp-bug-12671.pcapng.gz
http-brotli.pcapng Add brotli decompression support for HTTP and HTTP2 dissectors. 2019-04-22 15:24:46 +00:00
http-ooo.pcap
http-ooo2.pcap tcp: fix reporting of "Reassembled in" for OoO initial segment 2019-01-25 12:01:32 +00:00
http.pcap
http2-brotli.pcapng Add brotli decompression support for HTTP and HTTP2 dissectors. 2019-04-22 15:24:46 +00:00
http2-data-reassembly.pcap
icmp.pcapng.gz test: make 'double' tests rely on icmp instead of ntp. 2018-10-25 04:09:44 +00:00
ikev1-bug-12610.pcapng.gz
ikev1-bug-12620.pcapng.gz
ikev1-certs.pcap
ikev2-decrypt-3des-sha1_160.pcap
ikev2-decrypt-aes128ccm12-2.pcap
ikev2-decrypt-aes128ccm12.pcap
ikev2-decrypt-aes192ctr.pcap
ikev2-decrypt-aes256cbc.pcapng
ikev2-decrypt-aes256ccm16.pcapng
ikev2-decrypt-aes256gcm8.pcap
ikev2-decrypt-aes256gcm16.pcap
ipv6.pcap
ipx_rip.pcap
knxip_DataSec.pcap KNX-IP: new KNXnet/IP dissector 2018-10-16 09:03:43 +00:00
knxip_SecureWrapper.pcap KNX-IP: new KNXnet/IP dissector 2018-10-16 09:03:43 +00:00
knxip_TimerNotify.pcap KNX-IP: new KNXnet/IP dissector 2018-10-16 09:03:43 +00:00
krb-816.pcap.gz
many_interfaces.pcapng.1 Dumpcap: Fix writing SHBs and IDBs. 2018-11-16 19:28:11 +00:00
many_interfaces.pcapng.2 Dumpcap: Fix writing SHBs and IDBs. 2018-11-16 19:28:11 +00:00
many_interfaces.pcapng.3 Dumpcap: Fix writing SHBs and IDBs. 2018-11-16 19:28:11 +00:00
nfs.pcap
ntp.pcap
owe.pcapng.gz ieee80211: Support decrypting OWE captures 2019-03-26 08:56:03 +00:00
packet-h2-14_headers.pcapng
retrans-tls.pcap TCP: pass data after a ZeroWindowProbe to subdissectors 2019-01-27 09:47:54 +00:00
rsa-p-lt-q.pcap
rsasnakeoil2.pcap
sample_control4_2012-03-24.pcap
segmented_fpm.pcap
sip.pcapng
sipmsg.log
smb300-aes-128-ccm.pcap.gz test/suite_decryption.py: add smb2 decryption tests 2019-01-25 16:07:52 +00:00
smb311-aes-128-ccm.pcap.gz test/suite_decryption.py: add smb2 decryption tests 2019-01-25 16:07:52 +00:00
smb311-aes-128-gcm.pcap.gz smb2: add support for AES-128-GCM decryption 2019-07-02 17:54:03 +00:00
smb311-lz77-lz77huff-lznt1.pcap.gz smb2: add support for decompression 2019-07-15 21:00:14 +00:00
snakeoil-dtls.pcap
tcp-badsegments.pcap tests: add regression tests for Follow TCP Stream 2018-07-06 12:11:09 +00:00
text2pcap_hash_eol.txt
tftp.pcap
tls-fragmented-handshakes.pcap.gz TLS: Implement reassembly for Handshake messages 2019-04-24 21:02:35 +00:00
tls-renegotiation.pcap
tls12-aes128ccm.pcap
tls12-aes256gcm.pcap
tls12-chacha20poly1305.pcap
tls12-dsb.pcapng wiretap: add read/write support for Decryption Secrets Block (DSB) 2018-11-20 05:12:37 +00:00
tls13-20-chacha20poly1305.pcap
tls13-rfc8446.pcap TLS13: add final tests for RFC 8446 2018-08-17 07:28:56 +00:00
udt-dtls.pcapng.gz
wireguard-ping-tcp-dsb.pcapng Add support for embedding WireGuard keys in a pcapng file 2019-06-17 00:48:29 +00:00
wireguard-ping-tcp.pcap WireGuard: implement peer identification based on MAC1 2018-08-08 11:25:08 +00:00
wireguard-psk.pcap WireGuard: implement decryption with PSKs 2018-08-08 11:26:06 +00:00
wpa-eap-tls.pcap.gz
wpa-Induction.pcap.gz
wpa-test-decode-mgmt.pcap.gz
wpa-test-decode-tdls.pcap.gz
wpa-test-decode.pcap.gz
wpa1-gtk-rekey.pcapng.gz ieee80211: Fix WPA1 decryption 2019-04-03 15:25:54 +00:00
wpa3-sae.pcapng.gz ieee80211: Support decrypting WPA3-Personal / SAE captures 2019-03-21 12:13:58 +00:00