Commit Graph

89397 Commits

Author SHA1 Message Date
John Thacker afdbc17b96 capinfos: Fix count of IP address and decryption secrets
When opening a file offline, pcapng will read initial non packet
blocks in order to try to find the first interface, to try to
support conversion to file types only support one link layer type
and need to know it to set in the initial header.
(0d2a2d3777)

This means that initial NRBs and DSBs can already be processed
when the ipv4 and secrets callbacks are added. Wiretap ensures
that the callbacks are called for any NRBs (c65d5a0a80)
and DSBs (e8f9ac3352) that have
already been read when the callbacks are added. So far so good.

However, this means that capinfos needs to zero out the counters
*before* adding the callbacks, not afterwards.
2023-11-01 21:08:17 -04:00
Guy Harris a3fd4fd25b pcapng: convert FCS lengths between bytes and bits.
The FCS length in a pcapng IDB is in bits, but the length in an EPB is
in bytes; convert the latter to bits.

The FCS length in the Ethernet pseudo-header is in bytes; convert the
length-in-bits to a length-in-bytes before using it to set the FCS
length in the pseudo-header.

While we're at it, note, in a comment, that we convert the length in
pcap files, which is in units of 16 bits, to bits.

Fixes #19174.
2023-11-01 17:06:32 -07:00
João Valverde c9d41e2641 Revert "sttype-op(dfilter): fix Dead initialization"
This reverts commit acdee88430.

The use of a default switch statement prevents useful compiler
diagnostics, unlike the Clang Analyzer warning it purports to
fix.
2023-11-02 00:00:13 +00:00
João Valverde b40931cd17 dfilter: Print function argument types for constants
Print the function argument type if it is not a register.

Use square brackets with DFVM_STACK_POP to make clear
the argument is a count intrinsic to the instruction, not a
numeric field value.

Example:

    Filter:
     min(2, _ws.ftypes.int32, 1000)

    Instructions:
     0000 STACK_PUSH       2 <FT_INT32>
     0001 READ_TREE        _ws.ftypes.int32 <FT_INT32> -> R1
     0002 STACK_PUSH       R1
     0003 STACK_PUSH       1000 <FT_INT32>
     0004 CALL_FUNCTION    min(2 <FT_INT32>, R1, 1000 <FT_INT32>) <***> -> R0
     0005 STACK_POP        [3]
     0006 IF_FALSE_GOTO    8
     0007 NOT_ALL_ZERO     R0
     0008 RETURN
2023-11-01 23:18:46 +00:00
Guy Harris 27e8c8ebde FindPCAP: mystery solved!
Explain why __builtin_available() doesn't help with the problem in

[skip ci]
2023-11-01 15:55:57 -07:00
Guy Harris af91d78a54 macos-setup: don't build GLib tests, to work around a bug.
Somebody closed the bug, and may have been the person who claim it was
"some issue in a broken build system that did not auto-create the
missing header file", but if Meson+Ninja doesn't handle it, either it's
a problem with their Meson configuration, a problem with Meson, or a
problem with Ninja, so either they should fix it or they should report
the problem with the Meson or Ninja maintainers.

Maybe I'll look into why it's failing, and report the bug and perhaps
fix to some Directly Responsible Developers, at some point, but I have
other things on my plate, and another comment in that bug said disabling
the test build was sufficient, so....

[skip ci]
2023-11-01 15:35:31 -07:00
Jason Tang ec001766f6 WSLua DissectorTable GUID Support 2023-11-01 22:01:15 +00:00
Gerald Combs 14a934fb22 GitLab CI: More rules updates
Tighten up some of our rules and note what triggers each condition.
2023-11-01 21:13:19 +00:00
Guy Harris e9c7326d9c macos-setup: update to zstd 1.5.5. [skip ci]
It has a number of performance improvements and, even more important...

...it appears to let our settings for the minimum version to which code
can be deployed on macOS (and for the SDK to use) pass through to the
entire build process, unlike 1.4.5, which somehow seems to have
prevented that, which is why #19405 kept popping up.

Thanks to @tuexen for finding out that 1.5.5 seemed to finally get a
build of the libzstd lbirary that doesn't use Exciting New Run-Time
Linker Features that aren't supported by the run-time linker on older
versions of macOS for which we support Wireshark.
2023-11-01 20:38:54 +00:00
Gerald Combs 1b634a3a8b GitLab CI: Print more CI variables and update job rules
Try to avoid running jobs in cherry-pick branches.
2023-11-01 20:36:04 +00:00
Sergio de Paula 9be8dc83ad RF4CE: Improving dissector heuristic
Use a more restrictive heuristic for RF4CE
2023-11-01 16:23:14 +00:00
Joakim Karlsson e50ffe7cb1 ICMPv6: Add Option 21 PvD ID 2023-11-01 16:20:48 +00:00
Gerald Combs 53876ae73b GitLab CI: Show a commit log when we have multiple commits 2023-11-01 15:44:54 +00:00
Anders Broman 7733526e0a ENIP/CIP-I/O: Use CIP-I/O as protocol name for CIP-I/O
closes #19430
2023-11-01 15:18:53 +00:00
John Thacker 3173400167 addr_resolv: Remove confusing "only use profile hosts" preference
Once upon a time, Wireshark could use GNU ADNS instead of c-ares
for asynchronous DNS lookups. GNU ADNS didn't check the system
hosts file (see 51984de040), so
we added the system hosts file using the same mechanism as profile
paths when using ADNS.

This was then confusing, because "use external DNS resolver / use
system DNS resolving" could be off but /etc/hosts was still used,
so the "only use profile hosts" option was created to avoid using
external system DNS hostsnames at all.

c-ares (and, for that matter, libunbound) does read /etc/hosts, so
this option doesn't do its primary purpose anymore.  All it usually
does now is keep any hosts file in the global profile from being used,
but we don't have any other name resolution options where there's a
pref not to use global profile data.

Even more confusingly, if the option is true, then the -H option
to tshark to give a hosts file on the command line doesn't work.
add_hosts_file checks the preference and then doesn't actually
read the file from the command line, which is surely never wanted.

Most people don't understand what the option means, despite the
tooltip, and assume that it means "only use the hosts file as a
source of name resolution data", not "when using hosts files as
a source of name resolution data, only use the one from the personal
profile and not any from the global profile, the tshark command line,
or any other source."

Just mark the option as obsolete.

Related to #11470
2023-11-01 14:57:25 +00:00
Anders Broman 7ac827fd74 LAPD: Set address AT_STRINGZ
By setting the address the VoIP call flow graph shows the direction of
the signal in the flow.
closes #19445
2023-11-01 14:28:46 +00:00
Alexis La Goutte f051e97906 Fix Dead initialization found by Clang Analyzer 2023-11-01 13:47:52 +00:00
Alexis La Goutte acdee88430 sttype-op(dfilter): fix Dead initialization 2023-11-01 13:47:52 +00:00
Gerald Combs fa99fe81cc GitLab CI: Add plumbing for merge request feedback
Install the GitLb CLI in the Commit Check job and add warnings.
2023-11-01 12:44:20 +00:00
Jaap Keuter 4cf6568b2e Qt: fix handling display filter dialog TFS NULL value 2023-11-01 11:24:01 +00:00
Pascal Quantin 347fa8a8a1 tshark: fix memory leak when printing an IPv4 address 2023-11-01 10:27:35 +00:00
John Thacker de43cc7eee WSUG: Mention the at operator and field references
Describe the at operator and field references, taking some
information from the wireshark-filter man page and expanding some.

Create some cross-references between saved filters, filter buttons,
display filter macros, and field references, because they're all
useful to use with each other.

Fix #17594
2023-11-01 10:15:37 +00:00
Dr. Lars Völker 276fb25e61 ISOBUS: Remove incomplete warning and cleanup
- Adding reserved for incomplete dissections
- more consistent formatting
- adding sorting to make-isobus.py in case csv are not sorted in future
- adding macros to packet-isobus-parameters.h
2023-11-01 09:54:40 +00:00
Pascal Quantin 0ee04d759f GTP: add dissection of RIM Routing Address IE
Closes #19202
2023-11-01 10:10:42 +01:00
John Thacker 4d71744d84 uat: Small comment update about update callbacks
Note that one permissible way to have the update_cb actually
change a record, not just validate it, is if the same changes
are made by the copy_cb (e.g. by having the copy_cb call the
update_cb on the newly created record.) Some UATs do this.

[skip ci]
2023-10-31 20:04:05 -04:00
John Thacker 1484169815 prefs: GUI preferences don't affect dissection
The GUI preferences don't affect dissection in general and shouldn't
require a costly redissection.

We used to have a PREF_EFFECT_GUI, but it seems that nothing needed
to check it because any changes were noticed in other ways, so it
was removed. (d95213afb0) Bring it
back, because the Lua set_preference assumes that *some* effect
flag is returned when a preference is changed.

We have to set this separately for each submodule too, because
the effect flags are reset to PREF_EFFECT_DISSECTION regardless
of the parent module. The changes to columns, fonts, and colors
are also handled separately without special effect flags; the
layout submodule does have its own effect flag.

Fix #17629
2023-10-31 21:29:11 +00:00
Gerhard Gappmeier 3b09f561f2 opcua: add more comments 2023-10-31 21:26:47 +00:00
Gerhard Gappmeier 308336a05d opcua: add sanity check in keylog parser 2023-10-31 21:26:47 +00:00
Gerhard Gappmeier 9f17196a9d opcua: add lost sig_len parsing due to rebasing 2023-10-31 21:26:47 +00:00
Gerhard Gappmeier 2e835dc2c2 opcua: add encrypted capture file with embedded keys 2023-10-31 21:26:47 +00:00
Gerhard Gappmeier df8b016ea8 opcua: make strtok_r compatible with MSVC 2023-10-31 21:26:47 +00:00
Gerhard Gappmeier 3c9e7bc58b opcua: implement loading keylog file from pcapng embedded DSB 2023-10-31 21:26:47 +00:00
Gerhard Gappmeier 36e7c60c50 epan: export secrets_register_type to be useable in plugins. 2023-10-31 21:26:47 +00:00
Gerhard Gappmeier 8f3fc34a0c editcap: add new SECRETS_TYPE_OPCUA
This allows embedding the OPC UA keylog file into the pcapng file.
2023-10-31 21:26:47 +00:00
Huang Qiangxiong ca8594cc55 JSON: Shorten the name of JSON in INFO column 2023-10-31 21:24:10 +00:00
David Perry 5789bc7977 Use C99 instead of GLib types in doc+docbook
Ran `tools/convert-glib-types.py` over the files in `doc/` and
`docbook/`, then manually checked/massaged/reverted results as
appropriate.

One small step towards addressing #19116
2023-10-31 21:22:03 +00:00
David Perry 47b310da47 GTP, GTPv2: use wmem_maps instead of GHashTables
Use `wmem_map_t`s (with `wmem_file_scope()`) instead of `GHashTable`s in
`packet-gtp.c` and `packet-gtpv2.c`. This stops us from mixing wmem and
GLib memory allocations in these dissectors.
2023-10-31 21:14:47 +00:00
Gerald Combs 5f3ed0670e QUIC: Add a null check
Fix

```
*** CID 1548363:  Null pointer dereferences  (FORWARD_NULL)
/builds/wireshark/wireshark/epan/dissectors/packet-quic.c: 4051 in dissect_quic_long_header()
4045                 } else {
4046                     /* The client [may] know that the server supports greasing the
4047                      * QUIC bit, and perhaps will do so. (We can't really test if
4048                      * this token came less than 7 days ago from a server that
4049                      * supports it, so we'll assume it might be to be safe.)
4050                      */
>>>     CID 1548363:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dereferencing null pointer "conn".
4051                     conn->server_grease_quic_bit = true;
4052                 }
4053                 offset += (guint)token_length;
4054             }
4055         }
```
2023-10-31 20:31:52 +00:00
Stig Bjørlykke 7fc8ed84d8 Qt: Unmark field when not found in a Byte View
Remove the byte highlighting when selecting a field which is not
found in a Byte View (does not belong to a tvb).
2023-10-31 20:16:15 +00:00
David Perry d1f81f131e Alias my old email address in mailmap 2023-10-31 12:39:11 -04:00
Martin Mathieson e9b8349c14 ORAN FH CUS: Fix up ext 6 handling 2023-10-31 15:43:40 +00:00
John Thacker 6affa937f3 epan: Fix display filter macro post update
The UAT update_cb can *only* be used to validate an entry in ways
that cannot be determined by checking the UAT fields individually.
The update_cb is called on the copy of the record that is placed in
the UAT's user_data, not on the records that are in raw_data. When
the UAT is saved, the records in user_data are destroyed, and valid
records (as determined by running update_cb before) from raw_data
are newly copied into user_data. This *doesn't* cause the update_cb
to be run again, since the records were validated before. For this
reason, the update_cb should probably take a const void* not a void*.

This meant that Display Filter Macros were not parsed into their
parts and argument positions when the UAT was subsequently saved,
only on first load.

The only callback that is guaranteed to run whenever the data has
changed is the post_update_cb. Assign one, and call the former
macro_update (renamed and with slightly different signature; note that
it always returned true and never had an error before) on all the
macros then.

The comment about macros_init() adding a separate post_update_cb has not
been valid ever since GTK+ Wireshark went away, as QT Wireshark never
added that. The post_update_cb placed by the GTK+ macros_init was designed
to avoid a crash that is now avoided in Qt Wireshark by registering the
UAT with the UAT_AFFECTS_FIELDS flag (see a3806fc69b)

Fix #11946
2023-10-31 15:34:20 +00:00
Guerber a913c2a334 Apply 1 suggestion(s) to 1 file(s) 2023-10-31 15:23:22 +00:00
Jaap Keuter 8eceea5315 Apply 3 suggestion(s) to 1 file(s) 2023-10-31 15:23:22 +00:00
Christophe Guerber e240a45454 RTP ED137 Improve dissection with req/rsp and text in info column
Associate Request for Measurement Message (RMM) to its Measurement Answer Message (MAM) using request/response as in ICMP dissector.
Compute response time for RMM and determine dynamic delay measurement using Annex F formulas: using request/response association, we now know both time qualities.
Put additional features information in the info column for easier readability, especially New Measurement Request.
Removed unused field DDC unknown.
Added expert info: no response to RMM, RSSI index not compliant.
2023-10-31 15:23:22 +00:00
Gerald Combs 5d7a0c149a NSIS: Make a bunch of sections hidden / mandatory
Hide many of our installation sections from the components page, which
installs them unconditionally. This brings the NSIS installer behavior in
line with the Debian and RPM installers and simplifies the installer UI.

Leave the extcaps individualy selectable for now.
2023-10-31 15:17:41 +00:00
Vasil Velichkov 2dc3887a3b INAP: Fix dissection of local code in ExtensionField
Previously when a message contains an Extension Field with a local
code the operation name corresponding to this local code was added to
the Info column. This is incorrect as extensions local codes are not
operations.

This change is similar to how Extension Field is handled in the CAMEL
protocol.
2023-10-31 15:15:31 +00:00
João Valverde 9b62ec029e dfilter: Fix slices with byte references
Before:

    Filter:
     frame[:2] == $@frame[:2]

    Error: Range is not supported for entity @frame <FT_BYTES>
      frame[:2] == $@frame[:2]
                   ^~~~~~~
After:

    Filter:
     frame[:2] == $@frame[:2]

    Instructions:
     0000 READ_TREE        frame            -> R0
     0001 IF_FALSE_GOTO    7
     0002 SLICE            R0[0:2]          -> R1
     0003 READ_REFERENCE   ${@frame}        -> R2
     0004 IF_FALSE_GOTO    7
     0005 SLICE            R2[0:2]          -> R3
     0006 ANY_EQ           R1 == R3
     0007 RETURN
2023-10-31 14:54:19 +00:00
Dr. Lars Völker 1dd58a0559 ISOBUS: change to value_string_ext for faster lookup 2023-10-31 14:42:31 +00:00
Dr. Lars Völker 0256c588a7 UDS: change to value_string_ext for faster lookup 2023-10-31 14:37:00 +00:00