Commit Graph

81162 Commits

Author SHA1 Message Date
Guy Harris 6c043d5c73 wslua_tvb: fix documentation for reported_length_remaining().
In the past, tvb_reported_length_remaining(), and thus
Tvb:reported_length_remaining(), may have returned -1 if the offset was
invalid.  That's no longer the case; the former returns 0, and, as the
latter just returns the former's return value, that's true of the latter
as well.
2021-06-16 00:43:07 -07:00
Guy Harris bd9ceaebef wslua: a tvbuff doesn't have an "actual length".
It has a "reported length", which is the closes thing to an "actual
length", as it represents the length the packet, or subset thereof, had
on the network, and a "captured length", which is the amount of the
packet that the capture process saved.

In 99.999999999999999999999999999999% of all cases, a dissector should
look at the "reported length", not at the "captured length".

Rename the "len" method to "captured_len", leaving "len" around for
backwards compatibility.

Fix the documentation to reflect reality, to avoid issues such as #15655.
2021-06-16 07:12:12 +00:00
Adrian Granados 4fdf3f1038 ieee80211: Improve HE 6 GHz Capabilities IE dissector
Fixes field names and sets field values to be consistent
with equivalent HT and VHT capabilities fields as indicated
in the IEEE Std 802.11ax-2021 amendment.
2021-06-16 06:30:43 +00:00
Gerald Combs 2d9280089c GitLab CI: Add initial Windows package builds.
Start migrating the Windows package build steps from Buildbot.
2021-06-16 05:48:38 +00:00
Guy Harris 6771252f1b netlink: don't use -1 to mean "to end of packet".
Add dissect_netlink_attributes_to_end(), which takes no length argument,
and uses tvb_ensure_reported_length() to get the remaining length in the
packet.

In dissect_netlink_attributes_common(), treat negative lengths as if
they were a positive length >= 2^31, and throw a reported bounds error.

Also, throw a bounds error if there's more padding to a 4-byte boundary
than there is data in the packet.

At that point, we know the length is positive, so assign it to an
unsigned variable and use *that* in the loop.  Throw an error if the
attribute goes past the end of the packet (although we presumably would
have done that already).

(We really should eliminate all use of -1 as "to the end", and make
lengths unsigned.  We should also get rid of any places where we're
using negative offsets as offsets from the end of the packet - in the
few cases where you're dealing with trailers, you want to do that
carefully, so as not to throw an exception dissecting the trailer before
you get around to dissecting the rest of the packet - and make offsets
unsigned as well.)
2021-06-15 14:56:26 -07:00
Guy Harris e5ce3345db tvbuff: add tvb_ensure_reported_length_remaining().
It is to tvb_reported_length_remaining() as
tvb_ensure_captured_length_remaining() is to
tvb_captured_length_remaining() - it throws an exception if the offset
is out of range.

(Note that an offset that's just past the end of the {reported,
captured} data is *not* out of range, it just means that there is no
data remaining.  Anything *past* that is out of range and thus invalid.)
2021-06-15 13:32:46 -07:00
João Valverde 2c6d897b58 wslog: Add ws_logv_full() 2021-06-15 18:51:40 +01:00
João Valverde e37b2ae637 wslog: Remove unused macro 2021-06-15 18:51:40 +01:00
João Valverde 477e7f7300 wslog: Do not filter default domain 2021-06-15 18:51:40 +01:00
João Valverde bec7b0c609 wslog: Fixup color support 2021-06-15 18:51:38 +01:00
João Valverde ac4a0c056b wslog: Use g_date_time_format() 2021-06-15 18:28:02 +01:00
Joakim Karlsson 9be67f167f NAS 5GS: add support for more binary IEs
TS 29.502 ch6.1.6.4.4 n1SmInfoFromUe, n1SmInfoToUe, unknownN1SmInfo
2021-06-15 16:33:56 +00:00
Martin Gallo 85df6d0273 Kerberos: Add support for MS-KILE Key List Request messages
This adds the MS-KILE pre-authentication data types KERB-KEY-LIST-REQ [161] and KERB-KEY-LIST-REP [162] as per the latest Microsoft' Open Specifications.
Keys obtained from KERB-KEY-LIST-REP are learnt and saved for further use in other packets.

References:
- [MS-KILE] 2.2.11 KERB-KEY-LIST-REQ https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/a8198db9-b537-4256-b903-80a716540398
- [MS-KILE] 2.2.12 KERB-KEY-LIST-REP https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/38a494fc-2885-47eb-b008-3a1b574f3614
- [MS-KILE] 3.3.5.7.8 Key List Request https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/732211ae-4891-40d3-b2b6-85ebd6f5ffff
2021-06-15 14:51:07 +00:00
Constantine Gavrilov 01de470856 NVMe: fix for parsing data for logpage NVMeOF Discovery.
Take into acoount reported number of records.
Thus, discard extra payload, it target has not truncated response.
2021-06-15 17:01:01 +03:00
David Fort e43d26b39e rdp: many improvements and fixes
This big patch addresses the following items:

* implement the "message" virtual channel so that multi-transport and bandwidth
PDUs are dissected;
* prepare the identification of static channels to be able to dissect them later;
* fix the compression field in channelPDUHeader.channelFlags;
* implement the drdynvc channel dissector, so now we decode the traffic on this
channel and we're able to track data on dynamic channels and transition to UDP
transport
2021-06-15 08:42:47 +00:00
Constantine Gavrilov 6ba703cba7 MVMe: append command names for commands, responses and transfers to Info column. 2021-06-15 08:27:16 +00:00
Gerald Combs 147e7dce04 Debian: Remove a symbol.
Remove ws_log_fprint.
2021-06-15 00:39:02 -07:00
Nardi Ivan 50d878b92a HTTP3: add very basic support for PRIORITY_UPDATE frames 2021-06-15 06:11:17 +00:00
Guy Harris d92a4bfd90 netlink-route: don't dissect attributes for legacy messages.
They don't include any attributes - they're not large enough to contain
anything other than the netlink message header and the one-byte address
family.  For legacy messages, the attribute we hand to
dissect_netlink_route_attributes() is not aligned on a 4-byte boundary,
as it's the offset right after the 1-byte address family value;
dissect_netlink_route_attributes() will try to align that on a 4-byte
boundary, but that will go past the "immediately after the end of the
packet" offset, which can cause problems if any checking is done to make
sure the offset is valid.  Therefore, we don't try to dissect the
attributes, rather than relying on the attributes dissector to discover
that there's nothing left in the packet.
2021-06-14 22:24:52 -07:00
João Valverde dd78347a7e capture: Lower priority for some status messages 2021-06-14 22:05:35 +00:00
João Valverde 41fd46310f wslog: Change log format to display everything
Revert from alternating between function name and file name,
show both instead.
2021-06-14 22:05:35 +00:00
João Valverde 95396973e7 wslog: Add basic color support
This is just a basic framework to improve on, if desired.
2021-06-14 22:05:35 +00:00
João Valverde 69a217b95b wslog: Use buffered I/O
Use standard buffered I/O instead of printing to a string.
This is more efficient, cleaner and allows custom output per stream.
2021-06-14 22:05:35 +00:00
João Valverde 59eff63794 wslog: Rename default log level 2021-06-14 22:05:35 +00:00
João Valverde 42c6c4781f wslog: Add a diagnostic message. 2021-06-14 22:05:35 +00:00
João Valverde b91801a870 wslog: Add a --log-file cmd line option 2021-06-14 22:05:35 +00:00
João Valverde e86ac706ca wslog: Parse cmd line options in one pass 2021-06-14 22:05:35 +00:00
João Valverde 2d2cfa8d14 wslog: Make a variable static 2021-06-14 22:05:35 +00:00
Guy Harris 9aa128c45d netlink-route: the padding is there, but not in the message length.
The message length for legacy netlink route messages doesn't include the
padding in question.
2021-06-14 12:31:32 -07:00
Gerald Combs c36ebbafd4 FAQ: Update the "Where can I get help?" answer. 2021-06-14 12:03:03 -07:00
João Valverde 5ddc007023 wslog: Include pid in format 2021-06-14 14:18:38 +01:00
João Valverde 675c428dca wslog: Fix shadow variable 2021-06-14 13:13:12 +01:00
João Valverde 55f0fba85d wslog: Make error and critical levels not conditional 2021-06-14 13:13:12 +01:00
João Valverde 700d8e34db wslog: Rename environment vars to according to our conventions 2021-06-14 13:13:12 +01:00
João Valverde b20c8a6029 wslog: Update test suite 2021-06-14 13:13:12 +01:00
João Valverde 5a662ba3fb wslog: Add support for domain filtering
A domain filter can be given in the environment variable
'WS_LOG_DOMAINS' or in a command-line options "--log-domains".

The filter is specified as a comma separated case insensitive list,
for example:

    ./tshark  --log-domains=main,capture

Domain data type switches from an enum to a string. There is no
constaint on adding new domains, neither in code or at runtime.
The string format is arbitrary, only positive matches will produce
output.
2021-06-14 13:13:12 +01:00
João Valverde 82739fc4f5 wslog: Improve code modularity and efficiency
Also tweak format for readability.
2021-06-14 13:13:12 +01:00
João Valverde c025e793dd CMake: Remove -Wc++-compat
Happy days are here again.
2021-06-14 11:47:53 +00:00
Martin Mathieson d9c150169d NVME: fix typo 2021-06-14 09:22:17 +01:00
Martin Mathieson 8e099bb0c7 print.c: add length check to loop
Note that it was impossible to actually overflow
the buffer, and there is a check to flush and restart
if it gets to within a few bytes of the end, but static
analyzers (CID: 1477927) are unlikely to be able to work
this out.
2021-06-14 07:03:49 +00:00
Thomas Dreibholz 30f3d72061 Added corresponding documentation for new statistics. 2021-06-14 06:41:44 +00:00
Thomas Dreibholz 7ee68a7904 Added statistics for ScriptingServiceProtocol (SSP). 2021-06-14 06:41:44 +00:00
Thomas Dreibholz e204bb3205 Added statistics for PingPongProtocol. 2021-06-14 06:41:44 +00:00
Constantine Gavrilov 74a3fac004 NVMeOF: rename fields to pass code validation. 2021-06-14 06:21:46 +00:00
Constantine Gavrilov 5d35e28e45 NVMeOF: complete decoding of fabric commands.
Add support for:
* Authentication Send
* Authentication Receive
* Disconnect
2021-06-14 06:21:46 +00:00
Constantine Gavrilov c7e082c6de NVMe: use common block for decoding CQEs for fabric and IO commands. 2021-06-14 06:21:46 +00:00
Constantine Gavrilov 8bc0924c25 NVMeOF fabric commands: simplify decoding code using field definitions. 2021-06-14 06:21:46 +00:00
Constantine Gavrilov 45201049e0 NVMeOF fabric commands: switch TCP dissect to common NVMe code. 2021-06-14 06:21:46 +00:00
Constantine Gavrilov 0b101d54da NVMeOF fabric commands: support offset in commands and completions dissectors. 2021-06-14 06:21:46 +00:00
Constantine Gavrilov d576719df4 NVMeOF: move handling of NVMeOF fabric commands, fabric completions and fabric command transfers to packet-nvme.c.
RMDA implementation is moved to packet-nvme.c, will become common implementation.
2021-06-14 06:21:46 +00:00