Commit Graph

41717 Commits

Author SHA1 Message Date
Guy Harris 0e6c7c7bb2 protobuf: close another leak.
Close the directory handle we've opened before returning a failure
indication if pbw_load_proto_file() or load_all_files_in_dir() reports a
failure.


(cherry picked from commit f0abd29e48)
2021-05-22 02:35:02 +00:00
Guy Harris 161e765500 protobuf: close a leak when file loading fails.
Free the path we've constructed before returning a failure indication if
pbw_load_proto_file() or load_all_files_in_dir() reports a failure.

Also, explicitly compare pbw_load_proto_file()'s return value against 0,
to make it a little clearer that it's *not* a Boolean, it's a return
code (with 0 meaning success and different non-zero values meaning
failure; if it matters *which* failure it is, we should probably have
otherwise we should just make it a Boolean).


(cherry picked from commit f1ffe7d421)
2021-05-22 02:02:52 +00:00
Nardi Ivan 4a17759938 QUIC: improve handling of unencrypted padding data
0af60377b4 added an heuristic to detect (unencrypted) padding data;
it is based on the fact that all coalesced QUIC packets must have the
same CID.
Unfortunately it doesn't work when the CID length is 0.

Treat decryption error of SH packets as a non fatal error, report them
as possible padding data misdetectd as coalesced packets and try
decrypting next traffic.

Close #17383

(cherry picked from commit 389a899a18)
2021-05-20 11:50:48 +00:00
Uli Heilmeier ab13858b7f PTP: Check for enough bytes
Make sure we have enough bytes for Length and Type fields before we read
from tvb.
Using existing msg_len for the checks.

Closes: wireshark/wireshark#17355


(cherry picked from commit fd14396972)
2021-04-26 14:11:04 +00:00
Gerald Combs 31a3ec04a8 Version: 3.4.5 → 3.4.6.
[skip ci]
2021-04-21 11:56:15 -07:00
Gerald Combs 04f9d3e097 MS-WSP: Don't allocate huge amounts of memory.
Add a couple of memory allocation sanity checks, one of which
fixes #17331.


(cherry picked from commit b7a0650e06)
2021-04-20 16:05:59 +00:00
Stefan Metzmacher e49430b4d3 packet-ldap: fix regression for SASL handling
commit 19b3376a24
("LDAP bogus malformed errors: decoding encrypted data")
introduced 2 problems:

- guint decr_len = tvb_reported_length(decr_tvb); was
  always called with decr_tvb==NULL

- dissect_ldap_payload() was not called if sasl_tree is NULL,
  it needs to be called even if the tree pointer are NULL
  in order to have the COL_INFO setup correctly.

I guess this should also be backported to stable branches
(together with 2e6d3b571b
 "LDAP: SASL Buffer doesn't include Length field")

https://gitlab.com/wireshark/wireshark/-/issues/17347

Signed-off-by: Stefan Metzmacher <metze@samba.org>


(cherry picked from commit 1d623fd541)
2021-04-16 11:53:00 +00:00
Uli Heilmeier 0c1743656f LDAP: SASL Buffer doesn't include Length field
SASL Buffer starts after the SASL Buffer Length field. Therefore
we should only mark the bytes without the Length field.

Sample capture can be found in wireshark/wireshark#15128


(cherry picked from commit 2e6d3b571b)
2021-04-16 11:03:16 +00:00
Simon Holesch d28ded7244 ptvcursor: Fix crash with deeply nested subtrees
If the proto tree is more than 8 levels deep, the subtree_lvl array
length is extended, by allocating a new area and copying everything into
that new area. However the old array length wasn't calculated correctly,
so only part of the subtree_lvl array was copied, causing a crash after
two ptvcursor_pop_subtree() calls.


(cherry picked from commit fa483ac191)
2021-04-16 07:44:56 +00:00
Gerald Combs cb432b878e [Automatic update for 2021-04-11]
Update manuf, services enterprise numbers, translations, and other items.
2021-04-11 09:53:17 +00:00
Loris Degioanni 716dd09605 sysdig: a couple more fixes
- parse the number of system call arguments in a way that works for both V1 and V2 event blocks
- returned the correct error string when unable to read the nparams entry from a sysdig event block V2

(cherry picked from commit 7894b1d0ea)
2021-04-08 22:09:56 -07:00
Loris Degioanni e94d9f4549 sysdig: support the most recent version of sysdig
Update the pcap-ng reader and sysdig event dissector to support the second version of the sysdig event block, which was introduced after Wireshark's original implementation

(cherry picked from commit fbe8d3a00f)
2021-04-08 21:58:20 -07:00
David Perry f1677bd31c maxmind: add optional synchronous lookups
When tshark enables synchronous resolution of IP addresses to names,
forces calls to maxmind_db_lookup_ipv4()/_ipv6() to block-wait for the
maxmind response.

Proposed fix for #14691.

(backported from commit c0abaa06f7)
2021-04-04 02:16:48 -07:00
Guy Harris 4a7ddb6b1a tvbuff_subset: fix its implementation of string scanning.
Both subset_find_guint8() and subset_pbrk_guint8() pass the parent
tvbuff to tvb_find_guint8()/tvb_ws_mempbrk_pattern_guint8(), along with
the offset in that tvbuff.

That means that the offset they get back is relative to that tvbuff, so
it must be adjusted to be relative to the tvbuff *they* were handed.

For subsets of frame and "real data" tvbuffs, there's a single lump of
data containing the content of the subset tvbuff, so they go through the
"fast path" and get the offset correct, bypassing the broken code;
that's the vast majority of calls to those routines.

For subsets of *composite* tvbuffs, however, they don't go through the
"fast path", and this bug shows up.

This causes both crashes and misdissection of HTTP if the link-layer is
PPP with Van Jacobson compression, as the decompression uses composite
tvbuffs.

Fixes #17254 and its many soon-to-be-duplicates.


(cherry picked from commit 2ba52cdc0e)
2021-03-29 01:20:38 +00:00
Guy Harris 193b1fc545 wslua_tvb: correctly trim off the end of a tvbuff.
The length specified in a TvbRange is the *actual packet length*, not
the *sliced-to* length, so use tvb_new_subset_length() to cut it short.

This fixes the fix for #15655, and addresses at least some of the issues
in #17255.


(cherry picked from commit cda18f951e)
2021-03-28 03:01:34 +00:00
Nardi Ivan 3bca4e3b3f SMB2: fix two memory leaks
* Since c3342930 we don't free anymore the entries in the files hashtables.
The cleanest solution is probably to convert these hashtables into two
wmem_map_t structures and let the wmem core handling any cleanup.

* b0f5b2c174 added supported for chained compression; the uncompressed
tvb must be freed


(cherry picked from commit e677a909e1)
2021-03-25 16:01:01 +00:00
Uli Heilmeier 6b072b63f0 DNS: Fix pointer for is_multiple_responses
As discussed in wireshark/wireshark!2497 there is no need
for a pointer to a pointer.


(cherry picked from commit 337bdf8eb3)
2021-03-23 15:35:55 +00:00
Uli Heilmeier 06e20df535 DNS: IXFR/AXFR queries with multiple responses
IXFR and AXFR queries can have multiple DNS responses. As all responses
belong to one transaction, they have the same transaction ID.

We shouldn't handle them as retransmits.

Fix: wireshark/wireshark#17293
(cherry picked from commit 07fb47111e)
2021-03-23 11:49:13 +00:00
Guy Harris 95c7c1c0f2 kerberos: regenerate packet-kerberos.h.
We updated the template; regenerate the header.


(cherry picked from commit 7efb2120bc)
2021-03-16 22:42:49 +00:00
Guy Harris b5d65c0074 Move still *more* headers outside of extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".

(cherry picked from commit 2820156fbd)
2021-03-16 15:03:17 -07:00
Guy Harris f1f937dd26 Move more headers outside extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".


(cherry picked from commit 1e1f4e6b5f)
2021-03-16 11:21:16 +00:00
Michal Ruprich d0e6ad310b Moving glib.h out of extern C
(cherry picked from commit c8246c9973)
2021-03-16 02:07:58 -07:00
Alexis La Goutte 20a013b835 NAN(WiFi): Fix wrong variable size
NDPE Attribute is not dissected

Issue (and fix) reported by Darren Chen

Closed #17278


(cherry picked from commit 73de7b1325)
2021-03-12 12:14:28 +00:00
Alexis La Goutte fbbaa3d03d EAP: fix a memory leak
(cherry picked from commit 20a6fea312)
2021-03-12 08:52:21 +00:00
Dr. Lars Völker 3a657cb4fb TECMP: Adding missing reserved flag to timestamp (BUGFIX)
This patch fixes a bug in the current TECMP dissector that leads to
wrong timestamps, whenever the reserved flag is set to true.

Closes: #17279


(cherry picked from commit 5d709459c4)
2021-03-11 07:38:24 +00:00
Martin Mathieson 2f7cf6e528 DECT: "tranceiver" -> "transceiver"
(cherry picked from commit 933e7f5eb6)
2021-03-10 22:04:47 +00:00
Gerald Combs 45aed9966c Version: 3.4.4 → 3.4.5.
[skip ci]
2021-03-10 12:26:33 -08:00
Nardi Ivan 0de80702bd GQUIC: fix parsing of unknown (but valid) tags
This commit should be a proper fix for the regression reported in #17250
(7fd71536 is a simple workaround). Such regression has been introduced by
b287e716 while fixing the infinite loop reported in #16897.

b287e716, while fixing the infinite loop, broke the decoding of perfectly
valid tags not yet supported by Wireshark.

AFAIK, the root cause of the infinite loop is the overflow of the `offset`
variable. Therefore checking for this overflow should be sufficient to avoid
the loop.
Note that we already check for sensible values for the 'tag_len' variable;
we should update `total_tag_len` accordingly.

Some words about testing: other than correctly handling unknown but valid
tags, it is important that this commit doesn't reintroduce the infinite
loop bug.
Fortunately #16897 provided a POC trace. Unfortunately, if you revert
b287e716, this POC doesn't work anymore in master-3.4 and master branches,
but it still triggers the infinite loop in master-3.2 branch.
Therefore I have been able to manually check that this MR + the
overflow check is enough to avoid the infinite loop bug, at least in master-3.2.

Some traffic with unknown but valid tags is available in e2ee14ae03.


(cherry picked from commit 142cfb03ac)
2021-03-01 16:10:34 +00:00
Nardi Ivan 16bc7095b9 GQUIC: add decoding of CGST tag
Regression introduced by b287e7165e.

To avoid an infinite loop with malformed packets, that commit stops
parsing the tags list after finding an unknown tag.
When this "unknown" tag is perfectly valid but not supported by
Wireshark, we don't decode any subsequent (valid) tags anymore.

GQUIC is going to die soon and it is quite unlikely it will change in
the next future. Therefore the best/quick solution is simply decoding
any valid tag.

Close #17250


(cherry picked from commit 7fd7153696)
2021-02-24 19:45:30 +00:00
Guy Harris 4560ac0527 Lua: add routines to return pcap/nsec pcap/pcapng file type/subtypes.
These will be backported, for the benefit of Lua scripts that want those
specific file types/subtypes (typically in order to write files of those
types); that allows those types to be fetched without having to know the
right string to hand to wslua_wtap_name_to_file_type_subtype().

(cherry picked from commit bc3cc17bc4)
2021-02-23 00:10:40 -08:00
Gerald Combs 077a9c9354 [Automatic update for 2021-02-21]
Update manuf, services enterprise numbers, translations, and other items.
2021-02-21 10:31:58 +00:00
Gerald Combs 3fb8be3b91 NVMe Fabrics RDMA: Initialize a variable.
Make sure q_ctx is fully initialized. Fixes #17233.


(cherry picked from commit e29c934d72)
2021-02-16 08:49:37 +00:00
Gerald Combs b2c58d020c Be more strict about opening URLs.
In the proto tree, copy URLs instead of opening them.

In the export dialog, enable previews only if the advertised MIME type
*and* the contents of the file are plain text, GIF, JPEG, or PNG.

Add warnings to the wslua browser_open_url and browser_open_data_file
documentation.

Fixes #17232.


(cherry picked from commit e99c9afce8)
2021-02-15 16:50:02 +00:00
Chuck Craft 418c3360bf ip: ip_ttl _ws.expert fields not set if no tree
See 'if (tree) ...' comment
Closes #17228


(cherry picked from commit dde65b96cd)
2021-02-15 07:51:26 +00:00
Guy Harris 66e6f092f9 WSDG: deprecate wtap_filetypes.
Recommend the use of wtap_name_to_file_type_subtype() to get filetype
values, unless you need to run on older versions of Wireshark that don't
have it.

Don't even *mention* wtap_filetypes in the documentation for the new
wtap_ routines, as, if you have those routines, you have
wtap_name_to_file_type_subtype(), because it's one of those routines.

Fix references to "nul" while we're at it - it's "nil" in Lua.

(That part of the WSDG - the Lua reference - is generated, so this
involves changing the source code implementing the Lua routines.)


(cherry picked from commit 5b3c3d0682)
2021-02-14 06:35:08 +00:00
Jaap Keuter db364ed3d5 ASTERIX: fix dissection of I010_041 and I010_042 fields
Fixes #17226


(cherry picked from commit b9bdc803bb)
2021-02-13 14:52:33 +00:00
Guy Harris 3a60e4992d wslua: expose some libwiretap APIs in Lua.
Provide Lua version of wtap_file_type_subtype_string(),
wtap_file_type_subtype_short_string(), and
wtap_short_string_to_file_type_subtype().

This will be backported to the 3.2 and 3.4 branches, to allow scripts
not run on the bleeding-edge version to use them.


(cherry picked from commit f0ebc50762)
2021-02-13 05:48:04 +00:00
Gerald Combs 21f9f3f1f2 TShark: Load extcap preferences only when needed.
In our first pass through our options, look for ones that might require
extcap. Call extcap_register_preferences() only when that's the case.

Warn about missing extcap preferences only when we've loaded them.

(cherry picked from commit c7f66cf934)

Conflicts:
	tshark.c
2021-02-11 13:47:44 -08:00
Constantine Gavrilov 90ed3ff952 Fix dissection of transport connect payload for NVMEoF with RDMA.
(cherry picked from commit 28937e9022)
2021-02-11 10:17:39 +00:00
Harald Welte 5b97f29a9a packet-fr: Register for SLL dispatch to Frame Relay dissector
Without this patch, any Linux cooked packet capture on HDLC / frame
relay devices will not be dispatched to the proper dissector.

Such packets do carry a proper sll_hatype set to ARPHRD_FRAD and should
be dispatched accordingly.  However, the packet-fr dissector so far
did not register itself accordingly.


(cherry picked from commit b83f92a458)
2021-02-05 23:05:34 +00:00
Jaap Keuter d742da0e53 SIP: Fix header Id mapping
Fixes #17215


(cherry picked from commit 7401dbaa82)
2021-02-04 20:35:32 +00:00
João Valverde 003a730a20 Don't include config.h in system headers
Config.h must not be installed so configuration must be performed by client code.

Fixes #17190.


(cherry picked from commit 10178fdb09)
2021-02-03 14:56:33 +00:00
Jaap Keuter 49393cf362 S7COMM: remove array size from function interface
Fixes #17198


(cherry picked from commit 55d53dbf1b)
2021-02-03 08:22:49 +00:00
Dario Lombardo 39da36ad6e
ntp: remove size constraint for invalid refid.
When the refid contains non-ascii chars, the conversion function
returns a string longer than 4 chars. This results in an invalid
string if the output is limited to 4 bytes. Incidentally this
results in an invalid PDML output as well that caught this bug
in the first place.

Fix: #17112.
2021-02-02 11:36:27 +01:00
Gerald Combs 564a52be19 [Automatic update for 2021-01-31]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-31 10:30:58 +00:00
Gerald Combs e0abfddcc5 Version: 3.4.3 → 3.4.4.
[skip ci]
2021-01-29 11:52:30 -08:00
Gerald Combs 57e14a4190 USB HID: Avoid allocating a huge amount of memory (second try).
10204490d7 / MR 80 ensured that we didn't grow field.usages due to an
underflow, but it neglected to check for a sane array size. Add another
check to make sure we don't wmem_array_grow() too much. Fixes #17165 and
fixes #16809 more completely.


(cherry picked from commit 785e291c1b)
2021-01-28 22:20:52 +00:00
John Thacker 247f8a4b33 USB HID: Usage Minimum and Usage Maximum are inclusive
Usage Minimum and Usage Maximum are an inclusive, closed interval.
This fixes an fencepost error where the Usage Maximum value was
not being included as a possible value in the bitfield. Related
to #17014


(cherry picked from commit 5ca608f519)
2021-01-28 21:55:50 +00:00
Jaap Keuter 935de5c4eb ZVT: clean up some data points
(cherry picked from commit b4f74bac74)
2021-01-28 11:49:03 +00:00
Guy Harris 1b22b8ed51 epan: don't print nanoseconds if seconds isn't representable.
Fix for previous fixes to #17179.


(cherry picked from commit 4715f5021c)
2021-01-28 08:18:16 +00:00