Commit Graph

87247 Commits

Author SHA1 Message Date
João Valverde 51cc5a53a1 Gitlab templates: Be more forceful asking for a capture
Reproducer captures are essential for developers. Move the
request to the top of the template and be more forceful
stressing the importance of capture files to fix bugs
and implement feature requests.
2023-04-22 04:47:15 +00:00
João Valverde 153403f79a proto: Fix address display for ETHER, AX25, etc.
We were erroneously passing a GBytes pointer instead of a byte
array.

Fixes 0f66c595e2.
2023-04-22 04:01:59 +01:00
João Valverde 53b1930b02 proto: Fix memory leak
Need to decrement reference count after calling fvalue_get_bytes().
2023-04-22 04:00:41 +01:00
João Valverde 6da5304a7f ftypes: Fix memory leak
Need to decrement reference counter after calling fvalue_get_bytes().
2023-04-22 03:59:51 +01:00
João Valverde 8c337d72c4 ftypes: Add fvalue_set_bytes_data() helper 2023-04-22 03:59:21 +01:00
Ales Povalac 5985d5c0bc LoRaWAN: Fix wrong GPS longitude in Class-B beacon 2023-04-21 19:50:29 +00:00
Gerald Combs d7391c629c Falco bridge: Fix a switch block 2023-04-21 18:55:01 +00:00
João Valverde 2304886028 Qt: Sort display filter combobox by MRU
Sort the model by Most Recently Used, instead of Most Recently
Added. This improves the usability of the combobox and prevents
the most used filters from being pushed out of the list by newer
entries.

Add a monotonic increasing timestamp to each row, set it
when each entry is created or updated, and use it to sort the model.

Fixes #18997.
2023-04-21 18:54:05 +00:00
João Valverde dfffd13892 dfilter: Remove assertion on empty filter expression
Because existing code is dependant on the behavior that a null/empty
filter is a sort of valid input (presumably to avoid having to check
for that condition explicitly) add back that behavior to avoid a lot
of potential hidden cascading failures.
2023-04-21 19:11:26 +01:00
João Valverde c6fb33505e Fix GUI crash opening any capture file
Fixes assertion on empty display filter string.

(Odd that this isn't caught by the test suite.)
2023-04-21 19:03:51 +01:00
João Valverde 0d0d468b64 dfilter: Add separate state for first and second stages
This will allow resetting the code generation state if we
want to do multiple code generation passes.
2023-04-21 18:15:18 +01:00
João Valverde d73387c245 dfilter: Minor refactoring 2023-04-21 18:06:07 +01:00
João Valverde b7bdbf0eb0 dfilter: Add dfwork_build()
Add a separate function to structure the code better.
2023-04-21 18:05:48 +01:00
João Valverde c053b96f08 dfilter: Assert on invalid dfilter_compile input 2023-04-21 18:04:33 +01:00
João Valverde 435a2186ab dfilter: Cleanup handling of null/empty expressions 2023-04-21 18:04:33 +01:00
João Valverde 43117dd40f dfilter: Rename dfilter_compile_real() -> dfilter_compile_full()
The function is part of the public interface. The new name is better
and more descriptive.
2023-04-21 17:02:29 +00:00
João Valverde 9e98b13524 dfilter: Move flags to dfwork_t
Replace booleans with a flags field.
2023-04-21 17:02:29 +00:00
João Valverde 61bfa918f1 dfilter: Add a dfwork_parse() function
Split the scanning/parsing stage into a separate function to
improve the structure of the code.
2023-04-21 17:02:29 +00:00
João Valverde e1871ba81c dfilter: Normalize error handling
Fail compilation if error pointer is set. Remove other redundant
failure flags.

Remove lemon %parse_failure block. This should be unnecessary.
I think this is only useful if we are doing error recovery,
which we aren't.
2023-04-21 17:02:29 +00:00
João Valverde d92846969c dfilter: Rename struct member
Members inside a structure do not need a namespace
prefix.

Remove stale declaration.
2023-04-21 17:02:29 +00:00
João Valverde 00fe9bc3d5 dfilter: Remove a default case statement
Let a (good) compiler warn if there is a missing case
in the switch.
2023-04-21 17:02:29 +00:00
João Valverde 7c712c2e7d test: Try to make output format more readable
Replace the Python repr() syntax and the overly-long standard output
markers.

This format should make it easier to read the logs and copy-paste the
commands.
2023-04-21 16:42:14 +01:00
Nicolás Alvarez defd2d90fb Add initial dissector for Matter
Matter is an interoperable application-layer protocol to control IoT smart
home devices, maintained by the Connectivity Standards Alliance.

This dissector currently only parses the outer "message headers" and
"payload headers". The protocol also has encryption, a TLV encoding for
the payload, the application semantics of those TLVs, fragmented
payloads in UDP, support for TCP, etc. which is all missing from the
dissector for now, so there's still lots to do.

There is no defined port number (implementations pick an arbitrary port and
advertise it over mDNS), so I'm only making Matter available in "Decode As"
for now. In the future it would be nice to get the port from the mDNS
answers.

Some fields in the message header can be encrypted by "message privacy".
Since we don't support decryption yet, these currently show up as a
single "encrypted headers" field if the "message privacy" flag is set.
2023-04-21 13:45:13 +00:00
Martin Mathieson 74a1c4cab3 Add tools/check_val_to_str.py and fix some of the errors 2023-04-21 10:06:56 +00:00
David Fort b049406ca4 rdp: add support for clipboard and audio out channels
This patch adds basic parsing for audio out and clipboard redirection, only the
kind of message is parsed, not the complete body, but that already gives some
useful informations.
2023-04-21 09:00:26 +00:00
Alexis La Goutte f129fa3de8 ieee80211: fix bitmask and typo on display filter name
Warning: epan/dissectors/packet-ieee80211.c hf_ieee80211_ndp_annc_variant filter= wlan.ndp.token.variant  - mask has odd number of digits 0x003 expected max for FT_UINT8 is 2
Warning: epan/dissectors/packet-ieee80211.c hf_ieee80211_ndp_annc_variant filter= wlan.ndp.token.variant 0x003 with len 3 but type FT_UINT8  indicates max of 2

Warning: epan/dissectors/packet-ieee80211.c hf_ieee80211_twt_individual_flow filter= wlan.twt.individual_flow  - mask with non-contiguous bits 0x67 ( 0x67 )
Warning: epan/dissectors/packet-ieee80211.c hf_ieee80211_eht_tx_max_nss_20mhz_8_9 : - filter "wlan.eht.supported_eht_mcs_bss_non_sta.rx_max_nss_supports_eht_mcs_8_9" appears consecutively - labels are "RX Max NSS That Supports EHt-MCS 8-9" and "TX Max NSS That Supports EHt-MCS 8-9"
Warning: epan/dissectors/packet-ieee80211.c hf_ieee80211_eht_tx_max_nss_20mhz_10_11 : - filter "wlan.eht.supported_eht_mcs_bss_non_sta.rx_max_nss_supports_eht_mcs_10_11" appears consecutively - labels are "RX Max NSS That Supports EHt-MCS 10-11" and "TX Max NSS That Supports EHt-MCS 10-11"
Warning: epan/dissectors/packet-ieee80211.c hf_ieee80211_eht_tx_max_nss_20mhz_12_13 : - filter "wlan.eht.supported_eht_mcs_bss_non_sta.rx_max_nss_supports_eht_mcs_12_13" appears consecutively - labels are "RX Max NSS That Supports EHt-MCS 12-13" and "TX Max NSS That Supports EHt-MCS 12-13"
2023-04-21 08:57:59 +00:00
Alexis La Goutte 8b21aa303d radiotap(ieee80211): fix bitmask
Warning: epan/dissectors/packet-ieee80211-radiotap.c hf_radiotap_eht_data1_ru_mru_index filter= radiotap.eht.data_1.ru_mru_index  - mask has odd number of digits 0x0001FE0 expected max for FT_UINT32 is 8
Warning: epan/dissectors/packet-ieee80211-radiotap.c hf_radiotap_s1g_ndp_ps_poll_udi_2m filter= radiotap.s1g.ndp.ps_poll.udi  - mask has odd number of digits 0x1FFE00000 expected max for FT_UINT40 is 10
2023-04-21 08:57:59 +00:00
Alexis La Goutte 168bb776f3 ieee80211(radiotap): fix Clang Analyzer Dead Store 2023-04-21 08:57:59 +00:00
Alexis La Goutte 8387e919a8 ieee80211: fix some typo 2023-04-21 08:57:59 +00:00
Richard Sharpe 43d06c9fb3 draft: radiotap,ieee80211: Initial support for Wi-Fi 7 (EHT). 2023-04-21 08:57:59 +00:00
Richard Sharpe d180771cf0 draft: radiotap: Implement U-SIG support based on the RFC.
The RFC was posted in the Radiotap mailing list.

Change-Id: I8ddb1cd474d05c94d1b5a51eb5e16d548a313a86
2023-04-21 08:57:59 +00:00
Gerald Combs f01f81b87d falcodump: Catch exceptions when loading plugins
Consolidate some duplicate code.
2023-04-20 23:00:18 +00:00
Gerald Combs 9af7fe8724 FAQ: Update the compliance form & legal agreement section
Try to find a diplomatic way of saying "this stuff ain't free, folks."
2023-04-20 22:53:01 +00:00
Guy Harris 849beca63d Fix the "invalid interface" unit test.
The error message for a non-existent capture interface has changed;
change the tests to match.
2023-04-20 11:07:38 -07:00
João Valverde 297375df19 dfilter: Fix a memory leak
Don't leak error message string after creating a new dfilter
error object.
2023-04-20 15:29:33 +01:00
João Valverde 81a8777b9f dfilter: Make error a pointer
Make it easier and more natural to test for errors and hand-over
error results.
2023-04-20 14:12:39 +00:00
Daniël van Eeden 2faaf6c33b MySQL: Fix val_to_str usage
Fixes wireshark/wireshark#18995
2023-04-20 13:07:49 +00:00
Pascal Quantin 8f3d171c00 Qt: fix compilation with gcc 13.0.1 (Fedora 38) and Qt 6.4.3 2023-04-20 12:18:10 +00:00
Guy Harris 659876d108 Check for EAFNOTSUP errors on Linux.
On Linux, look for an error message of "socket: Address family not
supported by protocol"; if we see it, that's EAFNOTSUP, which means
either that 1) your kernel doesn't have PF_PACKET support configured in
or 2) this is a Flatpak package of Wireshark that's "helpfully" been
sandboxed.  Display a secondary error message indicating one of those is
likely the problem; mention the Flatpak one first, as that's more likely
than the second (if you can still configure PF_PACKET sockets out, it's
not the default, so it's unlikely to be the case).

See issue #19008.
2023-04-20 11:13:28 +00:00
Martin Mathieson 8f7e63bcd9 Use rval_to_str_const() when no specifier in 'unknown' string 2023-04-20 10:34:19 +00:00
Hiddencodes Sec 5d8edf73ab Support MAPI ROP Input and Output Buffer parsing. 2023-04-20 10:28:11 +00:00
David Perry 7bc9ff3135 OpcUa: ExtensionObject.TypeId is NodeId
As per #18868, the ExtensionObject.TypeId should be parsed as a NodeId,
not as an ExpandedNodeId.
2023-04-20 08:12:38 +00:00
Guy Harris 3cc9d33f65 Improve reporting of libpcap errors.
Expand the set of CAP_DEVICE_OPEN_ errors and warnings to include
specific errors for many of the errors and warnings libpcap returns.
(This doesn't include the errors that would definitely either be
Wireshark or libpcap bugs, such as PCAP_ERROR_NOT_ACTIVATED and
PCAP_ERROR_ACTIVATED.)

Don't give "make sure you have the right permissions" secondary error
messages if we know that the error isn't a permissions error.

For the PCAP_ERROR_ codes that we handle individually, don't bother with
the pcap_statustostr() string, as it would duplicate the error message
we're providing.

For the PCAP_ERROR_ codes we *don't* handle individually, give both the
pcap_statustostr() string and the pcap_geterr() string, to give the user
as much information as possible (even if that's just so that they can
give *us* as much information as possible to figure out what the problem
is).

This should remove the "how to support packet capturing on Debian"
message for "sorry, we don't support PF_PACKET sockets" error that shows
up if either 1) your kernel doesn't have PF_PACKET support configured in
or 2) this is a Flatpak package of Wireshark that's "helpfully" been
sandboxed.  See issue #19008.
2023-04-20 00:46:47 -07:00
João Valverde 482ba4fb76 RADIUS: Add a NULL check
Fixes #19006.
2023-04-19 22:42:00 +00:00
Guy Harris 6b763b3951 ilp, ulp: don't use the over-TCP dissector for media types.
"Over TCP" dissectors are usable only over byte-stream protocols, as
they have to carve individual PDUs out of a byte stream, doing
reassembly if necessary; dissectors registered in the media_type
dissector table get a reassembled PDU handed to them, and all the
special reassembly stuff they do isn't necessary and may cause
dissection not to work.
2023-04-19 20:42:06 +00:00
João Valverde afb3ea4cf8 NOE: Add UTF-8 validation 2023-04-19 21:15:55 +01:00
João Valverde 81ca50444a ftypes: Fix assertion
Fixes #19012.
2023-04-19 20:55:55 +01:00
João Valverde 1ff7b83037 ftypes: Add a hash/equal method
Add methods to make fvalues hashable with GHashTable.
2023-04-19 16:16:28 +01:00
João Valverde 7595af96a0 ftypes: Hide fvalue implementation
Exposing the fvalue_t implementation is exposing internal
details of the implementation. Fix that by making the fvalue_t
internal to the ftypes implementation and using setters/getters
where necessary.
2023-04-19 15:12:25 +00:00
João Valverde 0f66c595e2 ftypes: Replace GByteArray with GBytes
Fvalues are immutable objects. This isn't strictly true in
the case of FT_BYTES because of widespread use of
proto_item_set_len() but that can be worked around and using
GBytes should be more convenient for callers and make some
aspects of the implementation simplers (others not).
2023-04-19 15:12:25 +00:00