Commit Graph

41753 Commits

Author SHA1 Message Date
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
Guy Harris 9bcc1785c1 epan: don't use gmtime_s().
It has the "feature" that, if handed a negative value, it might just
exit.  gmtime() doesn't have that "feature", and is sufficiently
thread-safe for our purposes; use it instead, and check to make sure it
doesn't return a null pointer.

The previous fix for #17179 still used gmtime_s(); this doesn't, so it's
a better fix for #17179.


(cherry picked from commit bf265d7e7a)
2021-01-28 06:58:45 +00:00
Guy Harris e072a71256 epan: don't assume gmtime_s() or gmtime_r() succeed.
At least on Windows, gmtime_s() will *not* succeed if passed a negative
value.

Fixes #17179.


(cherry picked from commit 4e4a7c11c7)
2021-01-28 06:17:57 +00:00
Jaap Keuter 303a7cc58f ZVT: Use standard TCP segment reassemble support function
Fixes #17177


(cherry picked from commit 616d44cbb6)
2021-01-28 00:00:50 +00:00
Grzegorz Niemirowski cbdee60912 Fix TID bitmap name
(cherry picked from commit 6a860c979a)
2021-01-26 07:19:49 +00:00
Gerald Combs 24f56bec53 USB HID: Fix a memory leak.
Replace mismatched g_strdup() + g_free()s with
wmem_strdup_printf(wmem_packet_scope(), ...). Fixes #17124.


(cherry picked from commit 26f0db01a7)
2021-01-26 00:45:32 +00:00
Gerald Combs 2248cba00c [Automatic update for 2021-01-24]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-24 10:30:17 +00:00
Jason Cohen c8bc83cb9e f5ethtrailer: Some trailers are not detected
This corrects 2 issues with the detection heuristic for f5ethtrailers
causing trailers to be missed.

Fixes #17171
Fixes #17172

(cherry picked from commit b297afee3e)
2021-01-22 08:58:34 -06:00
Jaap Keuter 227ed8cced FC ELS: Fix address length of FCWWN address in logout message
Closes #17168


(cherry picked from commit 13e04a2192)
2021-01-22 11:51:50 +00:00
Pascal Quantin 4ea329548c NAS 5GS: fix display of IPv6 interface identifier
Do not use FT_IPV6 as an interface identifier could be wrongly identified
as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed
as such.

(cherry picked from commit f64eddfd01)

Conflicts:
	epan/dissectors/packet-nas_5gs.c
2021-01-20 15:49:11 +00:00
Pascal Quantin 632df36405 NAS EPS: fix display of IPv6 interface identifier
Do not use FT_IPV6 as an interface identifier could be wrongly identified
as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed
as such.


(cherry picked from commit b794e4798a)
2021-01-20 15:28:41 +00:00
Guy Harris 79b075365f Don't dereference a known-to-be-null pointer.
In dump_dfilter_macro_t(), if the dfilter_macro_t pointer is null, just
give up after printing the message that indicates that.

This should squelch several nullPointerRedundantCheck warnings from
cppcheck.


(cherry picked from commit 05b9e53777)
2021-01-20 09:27:38 +00:00
Guy Harris 886465a976 Squelch "Clarify calculation precedence" warning from cppcheck.
For

        A & B ? C : D

put "A & B" in parentheses, to clarify the precedence.


(cherry picked from commit 138041b545)
2021-01-20 07:35:44 +00:00
Nardi Ivan c297de3b27 QUIC: improve error reporting
When unable to decrypt SH packets we should visualize an error, via
expert info. This way we handle SH and LH errors in the same way.

Close #17077


(cherry picked from commit 9faf6d4e7b)
2021-01-17 11:53:09 +00:00
Dr. Lars Völker f4d5d56592 AUTOSAR-NM: True-False-String wrong way around for PNI (BUGFIX)
This patch fixes the PNI TFString, which was wrong. Correct is:
0 = "... contains no Partial Network ..."
1 = "... contains Partial Network ..."

Fixes #17154


(cherry picked from commit 238446dc91)
2021-01-14 13:39:46 +00:00
Dr. Lars Völker 85320d2b80 DoIP: Adding 2019 DoIP Type
Adding ISO13400-2019 DoIP Version 3.


(cherry picked from commit 69710ff117)
2021-01-13 10:45:03 +00:00
Uli Heilmeier 75c00f6d0d SIP: Fix parsing of multiple contact-param
contact-params are optional (s. https://tools.ietf.org/html/rfc3261#section-20.10).
Therefore, independently of contact-params, we should also check for additional contact-param.

Fixes: wireshark/wireshark#13752


(cherry picked from commit 02f2d18b2e)
2021-01-13 09:32:31 +00:00
Dr. Lars Völker d412877409 TECMP: Fixing wrong size of HW version in Status CM Msg (Bugfix)
The HW version is correctly parsed as 2 bytes but shown as 3 bytes in
the dissection. This is fixed here.

Fixes #17133


(cherry picked from commit 1546a0af26)
2021-01-06 17:04:51 +00:00
Orgad Shaneh c57c306762 TPNCP: Fix exception for commands/events without CID
+ Simplify length checks

(cherry picked from commit 4003a5f3ce)
2021-01-04 09:16:20 +02:00
Orgad Shaneh e71ff74953 TPNCP: Misc fixes for backward compatibility
(cherry picked from commits d2abcb09c1
and 26a822c968)
2021-01-03 08:25:53 +00:00
Orgad Shaneh 1d6e13c12e TPNCP: Fix spelling
(partially cherry picked from commit
eef4ba7ed7)
2021-01-03 08:03:23 +00:00
Nardi Ivan 17b2a16b5a TLS: fix display of Google QUIC Version in Transport Parameters
(cherry picked from commit a23915c9a8)
2020-12-31 11:45:09 +00:00
Valerii Zapodovnikov 89f62ccec2 DHCPv6: typo
(cherry picked from commit fbccfe9996)
2020-12-29 17:16:15 +00:00
Jaap Keuter b67f9a2f26 pcapng: add missing file format interpretation of EPB options
Add the file format interpretations of Enhanced Packet Block options which
are being read by wiretap, but missing from the file format dissector.


(cherry picked from commit c657a6f5e7)
2020-12-29 08:36:14 +00:00
Nardi Ivan f209b56885 GQUIC: add decoding of QLVE tag
Latest GQUIC versions encapsulate their first flight in Q043 packets.


(cherry picked from commit bfb889910a)
2020-12-20 14:29:29 +00:00
Nardi Ivan 2fa8940607 QUIC: improve heurist to avoid false positives
Improve visualization of "Version Negotiation" fields


(cherry picked from commit 60401ca54e)
2020-12-20 13:52:21 +00:00
Jaap Keuter af66bef360 IPv6: SRH setup correct DA for pseudo header
When a Segment Routing Header is present in the IPv6 packet provisions
have to be made to setup the right destination address for the pseudo
header used in checksum calculations. When segments are left in the header
the first address in the list has to replace the destination address.

Closes #17097


(cherry picked from commit 7052994a19)
2020-12-19 09:43:01 +00:00
Dr. Lars Völker 3b13b3051f SOME/IP-SD: hidden fields for entries are 16 bytes off (Bugfix)
This patch fixes a bug that lead to 7 hidden fields being off by
16 bytes.

Closes #17091


(cherry picked from commit ff23fb9f0c)
2020-12-19 08:17:47 +00:00
Gerald Combs 03ebce0c30 Version: 3.4.2 → 3.4.3.
[skip ci]
2020-12-18 13:57:11 -08:00
Nardi Ivan 7ac76765fc QUIC: update to draft-33
QUIC (final?) constants for v1 are defined in draft-33


(cherry picked from commit 91bd291b90ab78fa2ccb1eaca27fc1685f6ad0ab)
2020-12-18 07:44:30 +00:00
Guy Harris 64578cba75 fcdns: the Owner Id field is a 3-octet FC address, not a text string.
Make it FT_BYTES with SEP_DOT, like other 3-octet FC addresses.


(cherry picked from commit 19ffed19bd)
2020-12-16 17:14:54 +00:00
Guy Harris 9bb44ac156 fcswils: fix a comment.
In an ESS capability object, the well-known type and well-known subtype
fields are 1 byte, not 2 bytes.


(cherry picked from commit ed6f6a49aa)
2020-12-16 09:59:27 +00:00
Jaap Keuter 564ec58f6d FC: use ETHERTYPE_UNK when applicable, no excuses
Two interlocking problems cause the dissection of FC to fail in some cases,
as shown in the capture of the related issue.

The FC dissector assumes that ETHERTYPE_UNK in the data structure passed
to it is coming from the MDS header dissector only, and thus that header
sizes have to be taken into account. This is not / no longer the case.
It always passes down ETHERTYPE_FCFT. Therefore the MDS header size
checking does not apply to ETHERTYP_UNK, so is removed as condition.

The other FC related dissectors were forced to setup a data structure to
pass to FC for it to handle that part of the frame. Because these weren't
related to ethernet, these lazily set the ethertype field in the data
structure to 0. This unfortunately matches ETHERTYPE_UNK, triggering the
MDS header size checking in FC, leading to this issue. With the first
problem resolved, now make it explicit that unknown ethertype is indicated
by ETHERTYPE_UNK, not '0'.

Addresses primary part of issue #17084


(cherry picked from commit 3f0fc1b232)
2020-12-15 21:26:37 +00:00
Jaap Keuter e228784c4e FCdNS: use correct header field for field of flags
closes #17084


(cherry picked from commit 354a6fd015)
2020-12-15 20:27:50 +00:00
Nardi Ivan a2ceb50866 QUIC: fix a stack overflow
While at it, fix also a memory leak
Close #17073


(cherry picked from commit 4227e5a1ad)
2020-12-14 11:18:20 +00:00
j.novak@netsystem.cz c865975463 SNMP: Fix checking of SNMP v3 auth if MD5 method is used
When the user enters row to SNMP Users table in wireshark and Authentication model is set to MD5, row is ignored in processing. The reason is that constant for MD5 is 0, but the code checks if the value is defined by simple 'usm_p.user_assoc' condition. Therefore 0 never succeeds.
As item can have only listed values, I think the check can be removed.
Function verified on sample.

I propose to cherry pick the change to all stable branches.


(cherry picked from commit 7f376c7ced)
2020-12-13 16:47:38 +00:00
Nardi Ivan a16388824b QUIC: fix handling of unencrypted padding data
We must be able to correctly detect valid coalesced packets and
recognize them from random padding.

Close #17011
Close #16914


(cherry picked from commit 0af60377b4)
2020-12-13 11:38:54 +00:00
Andrii Vladyka 4908474b1f DOCSIS: Add FDX support to Downstream Active Channel List MDD TLV
(cherry picked from commit 37f11e9a36)
2020-12-12 20:34:03 +00:00
Jaap Keuter 18ada21232 USB-HID: Tertiery is usually three
(cherry picked from commit 976738cd6c)
2020-12-10 22:37:07 +00:00
Gerald Combs 10a02a65d7 Version: 3.4.1 → 3.4.2.
[skip ci]
2020-12-09 18:09:17 -08:00
George Powers 295d0a19fa Fix reported_len in Lua framewark when creating tvb from range.
This bug affects Lua plugin dissectors for encapsulation protocols like
GRE.  Typically the dissector creates a range for the payload packet, then
calls the next dissector with a tvb derived from the range, using
TvbRange_tvb().  The original version calls
tvb_new_subset_length_caplen() using the remaining capture length for the
reported_len argument.  The fix passes -1 as the reported length, and
tvb_new_subset_length_caplen() calculates the new reported_len as required.

The bug only affects large packets captured with a snaplen and
truncated, then decoded with a Lua plugin for the encapsulation header.

Here's the typical bug symptom, gleaned from tshark decode of
an encapsulated IP payload:

        [Expert Info (Error/Protocol): IPv4 total length exceeds packet length (114 bytes)]
            [IPv4 total length exceeds packet length (114 bytes)]

Closes #15655.

(cherry picked from commit e7ec6739b6)
2020-12-09 21:53:32 +00:00
John Thacker 181eb5cf82 epan: Fix format_text treament of Greek, Arabic, etc.
format_text uses the wrong bitmask when checking for two byte UTF-8
characters, resulting in rejecting half the possible two bytes characters,
including all of Arabic and Greek, and substituting REPLACEMENT CHARACTER
for them. Fixes #17070, and add some comments about the current behavior
that doesn't match existing comments.


(cherry picked from commit 770746cca8)
2020-12-09 13:31:23 +00:00
Yoshihiro Ueda 9cee503a87 SOME/IP: Fixed incorrect resetting offset of static array.
Fixed resetting offset of array to enable only when created tvb subset. Fixes #17057


(cherry picked from commit 2ab153527d)
2020-12-09 11:28:10 +00:00
Stig Bjørlykke 3cd179d007 Lua: Improve Listener error handling
Fix error handlers in Listener draw() and reset() to avoid getting
LUA_ERRERR from lua_pcall(). Added error handler for Listener draw()
callback.

Handle LUA_ERRERR from lua_pcall() to avoid assert on this.
Changed some capitalized words in various error message.

Closes #16974.


(cherry picked from commit d104571e8a)
2020-12-09 07:46:08 +00:00
Uli Heilmeier 41a97c978d SMB/SMB2: FS Name is always Unicode
According to MS-CIFS sections 2.2.8.2.6 [1] FS Name (or Label) string
is in unicode.

[1]: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/1011206a-55c5-4dbf-aff0-119514136940

Fixes: wireshark/wireshark#17064


(cherry picked from commit c876b34ed1)
2020-12-09 00:05:42 +00:00
Andrii Vladyka e507bee854 DOCSIS: Add FDX Sub-band TLV support in MDD Downstream Active Channel List
(cherry picked from commit 18ae9bd4e2)
2020-12-05 22:22:11 +00:00
Andrii Vladyka c3aef32766 DOCSIS: Fixed FDX Sub-band ID/offset TLVs dissection
(cherry picked from commit 708ada8381)
2020-12-04 20:57:07 +00:00
Guy Harris 2491a8f7f3 wlan: fix a bug-number typo in comments.
(cherry picked from commit 00d45cc71a)
2020-12-04 17:24:04 +00:00
Teyut c2d9eb4cfd RadioTap: skip present bits for vendor NS.
An error messages was shown when more than 1 present bits was set for a vendor NS because these bits were not skipped properly. Closes https://gitlab.com/wireshark/wireshark/-/issues/17047


(cherry picked from commit 96e31cb116)
2020-12-03 23:05:26 +00:00
Guy Harris 787e19080e wlan: never treat DMG frames as if they have an HT Control field.
At least one ns-3 capture has DMG frames (as indicated by the channel
number being in the 60 GHz band - radiotap currently has no DMG metadata
field) that have the +HTC/Order flag subfield set but have no HT Control
field, causing them to be misdissected.

802.11-2016 says that DMG frames should never have +HTC/Order set; if it
*is* set in a QoS frame known to be a DMG frame, flag it with an expert
info item and don't treat it as having an HT Control field.

Update a bunch of comments to give more information, put comments in the
appropriate places, and speak of 802.11-2016 rather than older standards.

While we're at it, update the title and description of the +HTC/Order
flag to reflect its name as of 802.11-2016.


(cherry picked from commit 3c640ca04a)
2020-12-03 20:37:29 +00:00
Guy Harris 1a79e899df PI_MALFORMED is not a valid error severity; fix it to PI_ERROR.
(cherry picked from commit ac0cf10ab0)
2020-12-03 12:36:18 +00:00
Nardi Ivan d88fadf46d QUIC: fix decryption when "loss-bits" feature is enabled
If the "loss bits" feature has been negotiated between the peers, the
algorithm used by Header Protection cipher must be updated.

See: https://tools.ietf.org/html/draft-ferrieuxhamchaoui-quic-lossbits-03

Close #17010


(cherry picked from commit 5798b91c15)
2020-12-02 17:57:28 +00:00
Gerald Combs fa53725469 Kafka: Limit our decompression size.
Don't assume that the Internet has our best interests at heart when it
gives us the size of our decompression buffer. Assign an arbitrary limit
of 50 MB.

This fixes #16739 in that it takes care of

** (process:17681): WARNING **: 20:03:07.440: Dissector bug, protocol Kafka, in packet 31: ../epan/proto.c:7043: failed assertion "end >= fi->start"

which is different from the original error output. It looks like *that*
might have taken care of in one of the other recent Kafka bug fixes.

The decompression routines return a success or failure status. Use
gbooleans instead of ints for that.


(cherry picked from commit f4374967bb)
2020-12-02 17:36:02 +00:00
Gerald Combs 5edf715c04 epan: Fix a memory leak.
Make sure _proto_tree_add_bits_ret_val allocates a bits array using the
packet scope, otherwise we leak memory. Fixes #17032.


(cherry picked from commit a9fc769d7b)
2020-12-02 16:43:07 +00:00
Harald Welte 970e9bfb2c packet-ehdlc: Fix TEI in COL_INFO
Back in 2017, commit d7bab0b46e introduced
printing the TEI in COL_INFO.  Unfortunatelky it contained a typo and
stated "TEI:1%u" instead of "TEI:%u".  So TEI 0 became TEI 10, etc. -
causing some confusion.

Let's remote that extraneous '1' and at the same time print the sapi
with two digits for better alignment of multiple lines. It is a
two-digit decimal value (0..63).


(cherry picked from commit 9c5ea50b0a)
2020-11-30 20:29:16 +00:00
Guy Harris 65c6d829db wlan: don't treat non-QoS frames as having an HT Control field.
That's QoS-frame only; for non-QoS frames, the +HTC/Order subfield
doesn't mean there's an HT Control field.

Update the reference to the part of the 802.11 standard mentioning that
subfield to 802.11-2016.


(cherry picked from commit 1fa5687fad)
2020-11-30 07:35:08 +00:00
Guy Harris be38cd2edb wlan: clean up some tests.
It's clearer to say

    if (A) {
        if (B) {
            do this;
        } else {
            do that;
        }
    }

than to say

    if (A && B) {
        do this;
    } else if (A && !B) {
        do that;
    }


(cherry picked from commit baee4a41c7)
2020-11-30 03:00:51 +00:00
Guy Harris 127f8e47ee 802.11: clean up data frame handling.
Change

    case DATA_FRAME:
        if (condition) {
            do stuff;
            break;
        }
        do other stuff;
        break;

to

    case DATA_FRAME:
        if (condition) {
            do stuff;
        } else {
            do other stuff;
        }
        break;

to make it clearer that it's "do this if condition is true, else do
that".


(cherry picked from commit 258fb14821)
2020-11-29 18:09:47 +00:00
Guy Harris d73b87e52a llc: don't fetch the etype until it's needed and if it's present.
This avoids throwing exceptions in some cases.


(cherry picked from commit ee764b8d7d)
2020-11-29 10:08:12 +00:00
Guy Harris 2f391e81d6 llc: clean up indentation.
(cherry picked from commit 3f8423c267)
2020-11-29 09:21:49 +00:00
Pascal Quantin 4d2c7b9940 S1AP: fix decoding of inter eNB transparent container from NGAP
(cherry picked from commit 74c0b2134b)
2020-11-24 13:45:38 +00:00
Pascal Quantin 095cb11a36 QUIC: fix compilation without HAVE_LIBGCRYPT_AEAD
(cherry picked from commit 8c99f4de8d)
2020-11-24 12:47:46 +00:00
Pascal Quantin dcd7a99f1d NAS 5GS: request type field is 3 bits long
(cherry picked from commit 9fdc3fb3ce)
2020-11-23 22:35:10 +00:00
Pascal Quantin 7097d817a2 NAS 5GS: fix PDU address type, PDU session type and SSC mode bit width 2020-11-23 16:56:17 +01:00
Nardi Ivan 436cddcc84 QUIC: fix handling of Key Update
After a key update, we should update Packet Protection cipher but
we shouldn't touch the Header Protection one.
With the current code, PP and HP ciphers are quite entangled and we
always reset both of them. Therefore, at the second key update we
reset the used 1-RTT HP cipher too; no wonder even header decryption
fails from that point on.

To properly fix this issue, all the ciphers structures has been rewritten,
clearly separating PP code from HP one.

Close #16920
Close #16916


(cherry picked from commit 5e45f770fd)
2020-11-23 08:47:47 +00:00