Commit Graph

45231 Commits

Author SHA1 Message Date
John Thacker f4fb92745e Diameter: Allow diameter command code text to be added to custom column
Create the command value string when loading the dictionary and
assign it to the command code field when registering it. This
makes it behave like any other value_string for adding to a custom
column (allowing resolved and unresolved), etc.

It could be changed to use a wmem_array instead of a GArray, as is
currently done with the AVPs.

Fix #16833. (Note that solving the analogous issue for the AVP
code text is more complicated, since the interpretation depends
on the vendor ID.)
2022-07-20 00:58:43 +00:00
Gerald Combs 3acd20fabe CMake+lrexlib: Another include path fix attempt. 2022-07-19 13:57:54 -07:00
Gerald Combs 9d96b301de CMake+lrexlib: Add another include path.
Include paths will be added until morale improves.
2022-07-19 13:04:44 -07:00
Gerald Combs 56a9666a3a wslua: Fix our argument definitions.
Make sure our argument definitions match their corresponding function
names.
2022-07-19 18:53:11 +00:00
João Valverde 84f54d54e5 dfilter: Fix a crash using abs()
Passing a literal value to abs() on the LHS segfaults, because it
is incorrectly assumed to be a valid field.

We need to check if we actually have a field. While at it improve
the diagnostic of literals.
2022-07-19 19:11:47 +01:00
Dr. Lars Völker 9e84721c1a TECMP: Updating to TECMP 1.7
The following changes are part of this patch:
- Make signed integer for analog default
- Analog Sample Time 0 is reserved now
- Updating Data Flags TX for CAN, CAN-FD, LIN, FlexRay, UART
- Show Parity Bits of LIN
- Expert Warning, when FlexRay Header CRC overflows into reserved bits
2022-07-19 15:25:56 +00:00
Dr. Lars Völker dec99a5f42 UDS: Adding IDs and Names for 2020 standard
This patch adds IDs and Names for:
- New UDS Services (0x29, 0x84, 0x86, 0x87)
- New ReadDTCInformation SubFunctions
- New Negative Response Codes

This patch does not dissection support for the new UDS Services.
2022-07-19 15:12:19 +00:00
John Thacker aa1c6db337 Diameter: Remove dead code for pre Internet Draft 16 protocol
There's some code intended to decode an older Internet Draft version
of Diameter, before December 2002. It's supposed to be set by an
obsolete enum preference, but due to a misunderstanding, it's
been dead code for the last 15 years. No one has complained in that
time, so instead of bringing the preference back and resurrecting
it, remove it and shrink the memory usage of the diameter dissector.

Related to #16833, as it will make adding the command code value
string simpler.
2022-07-18 23:31:41 -04:00
Gerald Combs 953c6f73aa CMake+lrexlib: Fix our include paths.
Try to fix

C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\epan\wslua\lrexlib\pcre2\../../wslua.h(52,1): fatal error C1083: Cannot open include file: 'epan/wslua/declare_wslua.h': No such file or directory [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\epan\wslua\lrexlib\lrexlib.vcxproj]
C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\epan\wslua\lrexlib\pcre2\../../wslua.h(52,1): fatal error C1083: #include <epan/wslua/declare_wslua.h> [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\epan\wslua\lrexlib\lrexlib.vcxproj]
C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\epan\wslua\lrexlib\pcre2\../../wslua.h(52,1): fatal error C1083: ^ [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\epan\wslua\lrexlib\lrexlib.vcxproj]
2022-07-18 09:47:34 -07:00
John Thacker 66978182d0 epan: Fix typo in conversation_create_endpoint_by_id 2022-07-18 12:00:42 +00:00
Kaige Ye c7afb52c84 MySQL: fix Auth Swith Request dissection 2022-07-18 09:37:17 +00:00
Gerald Combs a6b09b52b4 [Automatic update for 2022-07-17]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2022-07-17 16:38:11 +00:00
John Thacker 0749873c70 decode as: Add data dissector to all tables that support Decode As
Register the data dissector to all dissector tables that support
Decode As. This provides a way to disable decoding for table
entries that have a default dissector registered to a value.
It is particularly useful when a dissector is registered by default
to several values (e.g. HTTP), to be able to disable decoding
for one port without disabling the dissector in general.

It is also useful to prevent payloads from being handed off
to heuristic dissectors, and is thus distinguished from the
fallback to data when no dissector is set.  N.B.: that this has no
effect on dissectors that have a "Try heuristic sub-dissectors first"
preference set to TRUE.

It does not solve a second issue for table entries with a default
dissector - setting the dissector to "none" in order to force
payloads to be sent to heuristic dissectors without setting a
preference as above. (Note that in some cases one will wish to
send dissection on some ports to heuristics without enabling
heuristics first for _all_ ports.)

Fix #17518. Fix #15717. Related to #12098, which also needs the
last issue mentioned above addressed.
2022-07-16 16:02:36 -04:00
Tomasz Moń 22f7f56151 MaxMind DB: Significantly speed up stdout reader
Non-blocking reads were used to workaround Windows pipe handle leaks.
Now that the underlying issue is fixed (i.e. Wireshark no longer leaks
child process stdin/stdout/stderr handles), we can use blocking reads.

Using blocking reads is the main performance improvement. Reading more
than one byte at a time gives additional 15% performance improvement (on
top of enormous speedup due to blocking reads).

Avoid stdin and stdout file descriptor race conditions by closing the
descriptors only after the respective threads exit.
2022-07-16 14:55:22 +00:00
steve71 496dc0fcb3 TWAMP Test Frames: Adds dissection of PTP timestamps RFC8186
RFC8186 adds PTP timestamp option for TWAMP test frames. This small
change decodes these and the Z-bit which indicates their presence
2022-07-15 13:59:11 +00:00
Alexis La Goutte b9bc750fd8 conversation: fix -Wmissing-prototypes
conversation.c:339:1: warning: no previous prototype for function 'conversation_hash_element_list'
2022-07-15 13:45:52 +00:00
Alexis La Goutte b448b6a591 semcheck: fix -Wmissing-prototypes
semcheck.c:1110:1: warning: no previous prototype for function 'check_arithmetic_entity'
2022-07-15 13:45:52 +00:00
Alexis La Goutte bd28c19ad6 dvfm: Fix -Wmissing-prototypes
dfvm.c:206:1: warning: no previous prototype for function 'dfvm_value_tostr'
dfvm.c:550:1: warning: no previous prototype for function 'filter_finfo_fvalues'
dfvm.c:645:1: warning: no previous prototype for function 'filter_refs_fvalues'
2022-07-15 13:45:52 +00:00
Alexis La Goutte b68acb6bff pcre2: Fix -Wmissing-prototypes
lpcre2.c:506:13: warning: no previous prototype for function 'luaopen_rex_pcre2'
lpcre2_f.c:207:5: warning: no previous prototype for function 'Lpcre2_config'
lpcre2_f.c:234:5: warning: no previous prototype for function 'Lpcre2_get_flags'
2022-07-15 13:45:52 +00:00
Alexis La Goutte 1ca19b3c38 Fix -Wmissing-prototypes found by Clang
ftype-double.c:89:1: warning: no previous prototype for function 'val_unary_minus'
ftype-double.c:96:1: warning: no previous prototype for function 'val_add'
ftype-double.c:103:1: warning: no previous prototype for function 'val_subtract'
ftype-double.c:110:1: warning: no previous prototype for function 'val_multiply'
ftype-double.c:117:1: warning: no previous prototype for function 'val_divide'
ftype-integer.c:670:1: warning: no previous prototype for function 'uint_bitwise_and'
ftype-integer.c:677:1: warning: no previous prototype for function 'uint_is_zero'
ftype-integer.c:683:1: warning: no previous prototype for function 'uint_is_negative'
ftype-integer.c:689:1: warning: no previous prototype for function 'uint_unary_minus'
ftype-integer.c:704:1: warning: no previous prototype for function 'uint64_bitwise_and'
ftype-integer.c:711:1: warning: no previous prototype for function 'uint64_is_zero'
ftype-integer.c:717:1: warning: no previous prototype for function 'uint64_is_negative'
ftype-integer.c:723:1: warning: no previous prototype for function 'uint64_unary_minus'
ftype-integer.c:738:1: warning: no previous prototype for function 'sint_bitwise_and'
ftype-integer.c:745:1: warning: no previous prototype for function 'sint_is_zero'
ftype-integer.c:751:1: warning: no previous prototype for function 'sint_is_negative'
ftype-integer.c:757:1: warning: no previous prototype for function 'sint_unary_minus
ftype-integer.c:764:1: warning: no previous prototype for function 'sint64_bitwise_and'
ftype-integer.c:771:1: warning: no previous prototype for function 'sint64_is_zero'
ftype-integer.c:777:1: warning: no previous prototype for function 'sint64_is_negative'
ftype-integer.c:783:1: warning: no previous prototype for function 'sint64_unary_minus'
packet-bpv6.c:2182:1: warning: no previous prototype for function 'proto_register_bpv6'
packet-bpv6.c:2766:1: warning: no previous prototype for function 'proto_reg_handoff_bpv6'
packet-bpv7.c:1978:6: warning: no previous prototype for function 'proto_register_bpv7'
packet-bpv7.c:2037:6: warning: no previous prototype for function 'proto_reg_handoff_bpv7'
packet-realtek.c:349:1: warning: no previous prototype for function 'proto_register_realtek'
packet-realtek.c:436:1: warning: no previous prototype for function 'proto_reg_handoff_realtek'
packet-tcpcl.c:2147:1: warning: no previous prototype for function 'proto_register_tcpclv3'
packet-tcpcl.c:2211:1: warning: no previous prototype for function 'proto_reg_handoff_tcpclv3'
2022-07-15 13:45:52 +00:00
easonweii 52ddd86929 BGP: Fix dissector bug when BGP Update packets containing BGP Flowspec updates
Add support for BGP Update packets containing BGP Flowspec updates
Fixs #18198
2022-07-15 13:28:56 +00:00
Guy Harris f15b7b0ccc proto: fix proto_tree_add_bitmask_list_ret_uint64 to always return a value.
A "proto_tree_add..._ret_..." routine *must* return the value through
the pointer, even if no protocol tree is being built, as there's no
guarantee that a protocol tree will be built under all circumstances
(for example, if the dissection is only being done to generate the
column values, no column is a custom column, there are no coloring
rules, etc., so that none of the named field values are of interest, and
the protocol tree isn't going to be displayed, no protocol tree will be
built).

Fixes #18203.
2022-07-15 00:24:58 -07:00
João Valverde 4c975b770e dfilter: Improve compatibility of integer types
Before:

$ dftest '_ws.ftypes.int64 == _ws.ftypes.int8'
Filter: _ws.ftypes.int64 == _ws.ftypes.int8
dftest: _ws.ftypes.int64 and _ws.ftypes.int8 are not of compatible types.
	_ws.ftypes.int64 == _ws.ftypes.int8
	                    ^~~~~~~~~~~~~~~

After:

$ dftest '_ws.ftypes.int64 == _ws.ftypes.int8'
Filter: _ws.ftypes.int64 == _ws.ftypes.int8

Syntax tree:
 0 TEST_ANY_EQ:
   1 FIELD(_ws.ftypes.int64 <FT_INT64>)
   1 FIELD(_ws.ftypes.int8 <FT_INT8>)

Instructions:
00000 READ_TREE		_ws.ftypes.int64 <FT_INT64> -> reg#0
00001 IF_FALSE_GOTO	5
00002 READ_TREE		_ws.ftypes.int8 <FT_INT8> -> reg#1
00003 IF_FALSE_GOTO	5
00004 ANY_EQ		reg#0 === reg#1
00005 RETURN
2022-07-14 20:12:30 +00:00
msweant 53dcf53ae5 EAP: Encrypted IMSI Memory Bug
Added complete CertificateSerialNumber string match
logic to prevent malformed strings.  Added ASCII compliance
check prior to identity parsing and expert info warning.  Added
3GPP realm string matching logic to optional Realm token in Encr.
IMSI identities.

Closes #18129.
2022-07-14 19:18:45 +00:00
Aeneas Jaißle f5d997fd2d PPPoE: add TLV 0x90 value 0x03 "Double-tagged Ethernet", fix typo in "Encaps 2" 2022-07-14 16:07:45 +00:00
Alexis La Goutte 61f433406f thrift: Fix -Wdocumentation
packet-thrift.h:118:15: warning: parameter 'thrift_opt' not found in the function declaration
packet-thrift.h:119:15: warning: parameter 'is_field' not found in the function declaration
packet-thrift.h:121:15: warning: parameter 'field_id' not found in the function declaration
packet-thrift.h:122:15: warning: parameter 'hf_id' not found in the function declaration
packet-thrift.h:124:15: warning: parameter 'encoding' not found in the function declaration
packet-thrift.h:167:15: warning: parameter 'elt' not found in the function declaration
packet-thrift.h:169:15: warning: parameter 'seq' not found in the function declaration
2022-07-14 15:45:14 +00:00
Alexis La Goutte 134809fd80 bpv7: fix -Wdocumentation
packet-bpv7.c:483:11: warning: parameter 'obj' not found in the function declaration
2022-07-14 15:45:14 +00:00
Joakim Karlsson bf8577b88c pfcp: change to utilize proto_tree_add_bitmask_list 2022-07-14 12:46:09 +00:00
Alexis La Goutte b97556fabf ebhscr: Fix conflict
'ebhscr.lin.wakeup' exists multiple times with incompatible types: FT_UINT64 and FT_BOOLEAN
2022-07-14 11:13:54 +00:00
Alexis La Goutte f70e58a2eb erldp: fix conflict
'erldp.big_ext_str' exists multiple times with incompatible types: FT_BYTES and FT_STRING
2022-07-14 11:13:54 +00:00
Alexis La Goutte 204916c390 gsm_file: fix duplicate entry
Field 'File ID' (gsm_sim.file_id) has a conflicting entry in its value_string: 24380 is at indices 72 (DF.MExE) and 78 (DF.MexE)
Field 'File ID' (gsm_sim.file_id) has a conflicting entry in its value_string: 24384 is at indices 73 (DF.EIA/TIA-533) and 80 (DF.WLAN)
Field 'File ID' (gsm_sim.file_id) has a conflicting entry in its value_string: 20233 is at indices 194 (EF.EFSUPI_NAI) and 198 (EF.PBC)
Field 'File ID' (gsm_sim.file_id) has a conflicting entry in its value_string: 20234 is at indices 195 (EF.Routing_Indicator) and 199 (EF.PBC1)
2022-07-14 11:13:54 +00:00
Alexis La Goutte 19bc326f1b erldp: Fix duplicate entry
Field 'Tag' (erldp.etf_tag) has a conflicting entry in its value_string: 70 is at indices 12 (NEW_FLOAT_EXT) and 29 (DIST_FRAG_CONT)
2022-07-14 11:13:54 +00:00
Alexis La Goutte 1ff01f18bb ieee802154: fix duplicate entry
Field 'Id' (wpan.header_ie.id) has a conflicting entry in its value_string: 29 is at indices 2 (RendezVous Time IE) and 5 (Rendezvous Time IE)
2022-07-14 11:13:54 +00:00
Kaige Ye a89696dc2d MySQL: support CLIENT_QUERY_ATTRIBUTES capability 2022-07-14 10:32:29 +00:00
Joakim Karlsson edab806981 pfcp: correction of UP Function Features IE 2022-07-14 09:32:07 +02:00
Alexis La Goutte 32a4a08683 lapd: Fix Clang Analyzer warning
Access to field 'state' results in a dereference of a null pointer (loaded from variable 'ptr')
2022-07-13 20:55:49 +00:00
Alexis La Goutte 69ea1930a7 BGP: fix typo for EVPN Router's MAC (RFC9135)
Reported by Joe Neville => https://twitter.com/joeneville_/status/1544020405530279938
2022-07-13 18:59:56 +00:00
Anders Broman 4ea0e5de83 IPv6: Configurable IPv6 NAT64 prefixes 2022-07-13 18:24:36 +00:00
João Valverde f68f172454 dfilter: Remove a debug message
Still too noisy even with noisy level.
2022-07-13 16:06:28 +00:00
João Valverde 6c8a8d7960 dfilter: Fix dfvm code string
All/any equal have their own symbols for operators so cannot
be handled in the same switch case.

Other comparisons don't have different symbols for any/all.
2022-07-13 00:37:12 +01:00
Dirk Römmen 5a3b7488d9 BACnet: Added new vendor ID's, fixed BACnet SC decodings.
New vendor ID's up to june 22, 2022 have been added.
Decoding of the optional description field in BACnet SC BVLC's has been fixed.
Decoding of the exteded event parameters has been fixed.
2022-07-12 17:13:58 +00:00
Adrian Granados 3c29458a46 ieee80211: Update VHT channel width interpretation as in IEEE Std 802.11-2020 2022-07-12 16:42:23 +00:00
Chuck Craft e12954a637 epan: ws_debug log for heuristic that claims frame (len != 0)
It's possible for a dissector to claim a frame without adding to
the tree or being added to frame.protocols (see !6669)
Log a debug message showing the pinfo layers and the dissector that
claimed the tvb (frame/packet).
2022-07-12 14:15:33 +00:00
John Thacker 8ac995578c epan: Respect custom column resolved/unresolved status everywhere
Add a function to get the column text of the nth column, taking
into account whether the column is resolved or unresolved. Use
this function in the GUI, as well as in tshark, when writing
PSML, exporting dissection to PSML, etc., instead of accessing
col_data directly.

This removes the direct accesses of col_data from outside
column.c and column-utils.c

Fix #18168.
2022-07-12 00:22:11 +00:00
Dr. Lars Völker 868492fd2a Addr-Resolv: close vlans file on changing profile (BUGFIX)
Currently Wireshark does not close the vlans file on profile change.
This leads to major problems, when vlan resolution is turned on:
- Deleting a profile (not even selected) is not possible without exiting
  Wireshark.
- Switching from one profile with vlans to another with vlans, does
  not switch the resolution but stays on the names of the old profile!
2022-07-11 15:42:19 +00:00
Uli Heilmeier 0a6eae4df1 X509if: Increase MAX_RDN_STR_LEN to 128
Fixes: #18183
2022-07-11 15:07:09 +00:00
Gerald Combs d10253ebea [Automatic update for 2022-07-10]
Update manuf, services enterprise numbers, translations, and other items.
2022-07-10 18:42:22 +00:00
Dr. Lars Völker 298a46446a SOME/IP: Make uats much more robust against faulty configs (BUGFIX)
This patch improves the uat config checking for SOME/IP:
- detecting simple endless loops
- better error output on faulty configs
- using uat resets to fix crash on faulty configs
2022-07-10 11:38:04 +00:00
Dr. Lars Völker cbe62539b2 TECMP: Update Control Message IDs
This patch updates the Control Message IDs to TECMP 1.6/1.7. Since
some of the IDs are up to the user to configure, a UAT was added.
2022-07-09 17:31:36 +00:00
Dr. Lars Völker fad4d7f608 SOME/IP, Signal-PDU, IPduM: Harmonize uat comments 2022-07-08 21:59:51 +00:00
John Thacker 02b00a8ee5 epan: Copy multifield custom column undecoded values correctly
When writing a custom column, some field types can't have a resolved
value, and just copy the label from the expression to the value.
Only copy information from the most recent field when doing so,
so that with multifield custom columns the entire unresolved value
doesn't get overwritten with the resolved value (if some fields
have resolved values and some don't.) This also reduces copying
from O(N^2) to O(N).

Fixes the display "unresolved" value for multifield custom columns
that are a mix of field types.
2022-07-08 09:54:54 -04:00
Emmanuel Pauchard 79afe8e202 IEEE 802.15.4: CSL: Add dissector for RendezVousTime IE (#18182)
The dissector enables support for CSL Wake Up Frames.
2022-07-08 11:00:51 +00:00
Andreas Schultz ccbc0d5fe9 pfcp: add TP IPFIX and Trace IEs 2022-07-08 01:08:33 +00:00
Andreas Schultz d7720667d9 pfcp: add TP packet measurement IE 2022-07-08 01:08:33 +00:00
Andreas Schultz 70b7a42f73 pfcp: add TP Created NAT Binding 2022-07-08 01:08:33 +00:00
John Thacker 7a6ff3e5fe prefs: Remove custom column expression limit
Custom column expressions do not need to be limited to COL_MAX_LEN.
The size of the expression does not have any necessary relationship
to the size of the column contents, especially in the common case of
many semantically equivalent different fields from different protocols,
only one of which appears in any given frame.

The only place that actually does limit the length of custom
custom expressions is in reading the preferences. Use a GString
instead of allocating a buffer to COL_MAX_LEN when constructing
the string. In normal cases, this should decrease temporary
memory usage. Fix #16905
2022-07-07 12:52:19 +00:00
Guy Harris abe8798b78 nhrp: clean up extension parsing.
For the top-level item for an extension, initially create it with a
length of "to the end of the packet" and, when we finish dissecting it,
set the length appropriately.  That way, if the length is too large, we
don't throw an immediate exception, making it a little clearer what's
happending.

When dissecting an authentication extension, construct the text of the
top-level item as we dissect it, and initially create it with a length
of "to the end of the packet" and, when we're finished dissecting it,
set the length appropriately.  That way, we don't throw an exception
before doing any dissection if the data for the item isn't all there, we
only throw an exception when we run out of data, and we also don't try
to add the data unless there is at least one byte of data.

The latter of those fixes #18181.
2022-07-07 02:26:27 -07:00
Gerald Combs 75efbb1ac4 Rename Logwolf to Logray
Switch to the name "Logray" for the log analyzer. Rays are biological
cousins of sharks and more people like the name "Logray" in a completely
unscientific survey here. Apologies for any inconvenience this might
cause.
2022-07-06 15:04:25 +00:00
Martin Mathieson eab62aa768 Fix some spellings. 2022-07-06 09:02:37 +01:00
John Thacker dd5e2f3b3f epan: Fix return value of prooto_strlcpy when not enough room
proto_strlcpy in normal situations returns the number of bytes
copied (because the return value of g_strlcpy is strlen of the
source buffer). It can copy no more than dest_size - 1, because
dest_size is the size of the buffer, including the null terminator.
(https://docs.gtk.org/glib/func.strlcpy.html)

Returning dest_size can cause offsets to get off by one and reach
the end of the buffer, and can cause subsequent calls to have
buffer overflows. (See #16905 for an example in the comments.)
2022-07-05 22:12:41 +00:00
John Thacker 5ef4da4d98 epan: Prevent buffer overflows in some built-in addr_to_str types
Several of the constant length string built in address types don't
check to see if the buf_len passed in is long enough to write
the string.

This can cause buffer overflows, e.g. with a custom column with
many FT_ETHER fields.
2022-07-05 21:56:54 +00:00
David Perry 88a7bf9db2 Properly free range strings, ext strings, custom base 2022-07-05 20:43:31 +00:00
David Perry 51315cf37c Fix AUTOSAR heuristic label 2022-07-05 19:19:56 +00:00
João Valverde 5e3a7e9ab8 dfilter: Small optimization for "not all zero" code
Remove extra NOT instruction. Also remove unused ANY_ZERO opcode.
2022-07-05 09:58:43 +01:00
Deepthi Mary dfa160832d Adding 9 zbee zcl frames 2022-07-05 07:25:46 +00:00
João Valverde a877f2d5f3 dfilter: Allow existence check for slices
Allow checking if a slice exists. The result is true if the
slice has length greater than zero.

The len() function is implemented as a DFVM instruction instead.
The semantics are the same.
2022-07-04 22:45:14 +00:00
João Valverde 0fc81c21b2 dfilter: Cleanup scanner value setters 2022-07-04 22:15:40 +00:00
Gerald Combs ff36056573 [Automatic update for 2022-07-03]
Update manuf, services enterprise numbers, translations, and other items.
2022-07-04 21:30:14 +00:00
Joakim Karlsson 2fe99d640f pfcp: Update to 3GPP TS 29.244 V17.5.0 2022-07-04 19:57:09 +00:00
Anders Broman fed641fc27 http: Add path components to tree 2022-07-04 17:45:08 +00:00
Uli Heilmeier 1489ea8fe6 SMPP: Initialize tvb_msg to NULL
Fixes: wireshark/wireshark#18170
2022-07-04 18:12:03 +02:00
Guy Harris 1018e39ea3 eap: add a comment asking why dissect_eap_identity_wlan() exists?
Must identity strings in EAP be dissected differently over different
protocols?
2022-07-03 23:27:40 -07:00
John Thacker 50a3ac0c18 diameter: Strengthen heuristic slightly
The Diameter message length must be a multiple of 4, something
implicitly true in RFC 3588 and make explicit in RFC 6733.
2022-07-03 21:25:57 -04:00
John Thacker d5c81ba9d8 ath: Add heuristics
Port 45564 is not IANA registered for Apache. The heartbeat
messages all start with the same 8 character ASCII delimiter
string, so use that for heuristics.
2022-07-03 14:54:56 -04:00
John Thacker d065e9ac50 Diameter: Add a heuristic dissector over TCP
Add a heuristic dissector for Diameter over TCP, disabled by default.
We shouldn't need one for Diameter over SCTP, the PPID should take
care of it.
2022-07-03 12:36:31 -04:00
João Valverde 8d93f0920a dfilter: Fix some debug strings 2022-07-02 21:21:12 +01:00
John Thacker c88107f632 diameter: Register the [D]TLS port
Port 5868 is IANA registered for Diameter over TLS/TCP and
DTLS/SCTP. Register the diameter TCP handle by name so that
it can be registered to tls.
2022-07-02 12:18:28 +00:00
John Thacker f30062b9d5 egd: Do some simple heuristics
GE Fanuc's Ethernet Global Data uses a unassigned UDP port.
Add some simple heuristics, based on the fixed first two bytes
of the message.
2022-07-02 11:25:40 +00:00
João Valverde eb8acd088e dfilter: Rename dfvm opcodes with a namespace prefix 2022-07-02 11:46:45 +01:00
João Valverde fc5c81328e dfilter: Rename test syntax tree node
Test node also includes arithmetic operations so rename it
to a generic "operator" node.
2022-07-02 11:39:17 +01:00
João Valverde b10db887ce dfilter: Remove unparsed syntax type and RHS literal bias
This removes unparsed name resolution during the semantic
check because it feels like a hack to work around limitations
in the language syntax, that should be solved at the lexical
level instead.

We were interpreting unparsed differently on the LHS and RHS.
Now an unparsed value is always a field if it matches a
registered field name (this matches the implementation in 3.6
and before).

This requires tightening a bit the allowed filter names for
protocols to avoid some common and potentially weird conflicting
cases.

Incidentally this extends set grammar to accept all entities.
That is experimental and may be reverted in the future.
2022-07-02 11:18:20 +01:00
Stig Bjørlykke 190404d66b dtls: Support Connection ID when using Block Ciphers
Add support for DTLS Connection ID when using Block Ciphers,
the MAC algorithm is different.
2022-07-01 21:31:51 +00:00
Guy Harris 0257b41167 iec104: dissect the control field as a 4-octet little-endian field.
Treat all 4 octets of the control field as a single little-endian value
divided into bitfields.  We already showed *some* subfields as
bitfields; this means we show *all* of them that way.

That makes the display more clearly show which bits in those octets
correspond to which fields.

It also fixes the dissection of the type field; we have separate
bitfields for I frames (1-bit bitfield) and S and U frames (2-bit
bitfield).

Use proto_tree_add_item_ret_uint() to fetch the values other than the
frame type value.

Fixes #18167.
2022-06-30 23:35:52 -07:00
Odysseus Yang b250224c45 MBIM: dissect SAR commands
MBIM_CID_MS_SAR_CONFIG
MBIM_CID_MS_TRANSMISSION_STATUS
2022-06-30 17:21:15 +00:00
Roland Knall b165f31cd3 gtp: Fix copy-paste error 2022-06-30 16:38:05 +02:00
John Thacker 774a7f0eee dcp-etsi: Strengthen heuristic, add for Decode As
Strengthen the DCP-ETSI (TS 102 821) heuristic from matching
two bytes to matching four bytes. Split the heuristic and
non-heuristic dissector pieces, and add the non-heuristic
dissector for Decode As.
2022-06-30 07:29:46 -04:00
Dr. Lars Völker 4a26993ec0 SOME/IP: code cleanup to reduce memory leaks 2022-06-30 04:34:22 +00:00
Moshe Kaplan 96c4c9063f packet-gtp.c: Fix copy-paste error (Coverity 1506627)
Use guaranteed uplink bitrate,
instead of max uplink bitrate, when
calculating guaranteed uplink bitrate.
Fixes Coverity 1506627 and #18164.
2022-06-30 03:03:24 +00:00
John Thacker 37d3c7add2 STUN: Check the Fingerprint (CRC32) 2022-06-29 21:57:10 -04:00
John Thacker 7f5089ba40 knxip: Add a port range preference
KNX/IP has an IANA registered port, 3671, and some other ports commonly
used but unregistered (or registered to other services). It also has
no heuristics. Add a port range preference defaulting to the registered
port.
2022-06-29 21:41:25 -04:00
John Thacker 6c16cd7cbb tplink-smarthome: Add a brief heuristic
tplink-smarthome uses a port registered by IANA to another application.
At least add a heuristic; since the message is always JSON, we
can decode and test the first two characters.
2022-06-29 19:29:22 -04:00
Moshe Kaplan 1b586a66df register.c: Avoid potential race condition (Coverity 1477510)
Wrap writing to cur_cb_name in a mutex, to avoid
potential race conditions.
Fixes Coverity 1477510.
2022-06-29 11:21:25 -04:00
Tomasz Moń 88c8bb19e5
USBLL: Dissect speed specific linktypes
USB 2.0/1.1/1.0 devices (or 3.x and newer when connected to hosts that
are not Super-Speed capable) operate at one of three speeds:
  * Low-Speed (1.5 Mbps)
  * Full-Speed (12 Mbps)
  * High-Speed (480 Mbps)

Supporting speed specific linktypes allows speed specific dissection
without the need for user to manually set the speed.
2022-06-29 05:56:03 +02:00
John Thacker d41127602a STUN: Set conversation dissector after any STUN packet
After implementing RFC 7983, the STUN dissector will reject
DTLS and [S]RTP packets even in non-heuristic mode. Since
the dissector is more discriminating, it is safe to set
the conversation dissector after receiving any valid STUN
packet, not just specifically a TURN packet.

This makes dissection work better on some captures that have
some TURN ChannelData messages along with STUN packets in
the other direction, but lack the packets that set up the
TURN Channel. In turn, that allows the Decode As setting to
be configured for RTP, which has a weaker heuristic dissector
than STUN. Fix #18148.
2022-06-28 21:51:29 -04:00
Dr. Lars Völker 487165dd50 DoIP: Support UAT for User defined payload types
This patch allows user defined payload types to have names.
2022-06-28 18:38:53 +00:00
Martin Mathieson 33031c8955 Make some variables in packet-grebonding.c static. 2022-06-28 16:51:35 +01:00
Gerald Combs eaae2d0ee7 Minor Python3 script fixups.
Make some scripts executable and use the shebang line recommended at
https://docs.python.org/3/using/unix.html#miscellaneous
2022-06-27 16:46:55 +00:00
Gerald Combs 4153af1dc7 wslua: Port make-init-lua to Python3
Port the script that creates init.lua to Python3. The generated init.lua
removes one newline and adds another, otherwise the output is identical
to the Perl version.
Ping #18152.
2022-06-27 16:28:36 +00:00
Gerald Combs ae3010cabe wslua: Port make-taps to Python3
Port the script that creates taps_wslua.c and taps.txt to Python3. The
generated taps_wslua.c has one less newline, otherwise the output is
identical to the Perl version. Make the "taps" configuration file an
ConfigParser / .ini file.
Ping #18152.
2022-06-27 16:11:34 +00:00
Roland Knall 8bdff72625 dfilter: Fix undefined dereference and add null check
A value of ref could be accessed undefined and add additional
checks to ensure, that refs_array actually contains data or return
null immediately
2022-06-27 14:57:01 +00:00
Dr. Lars Völker d562cc3033 PTP: Improved robustness on wrong 2-step flag and 1-step
This code adds more robust handling of smaller issues with PTP messages,
like a missing 2-step flag of a not quite correct implementation of
802.1AS and improves 1-step support.

Changes:
- Handle 1-step syncs in analysis.
- Handle missing 2-step flag on pDelay more robust and warn in analysis.
- Handle missing F'up TLV in 802.1AS Sync more robust and warn.
2022-06-27 13:23:27 +00:00
John Thacker 26b0a0a8d3 stun: Tighten heuristic by rejecting restricted values
Reject the previous reserved and unassigned TURN channels and
STUN methods restricted by RFC 5764 and RFC 7983 to allow
multiplexing of STUN with DTLS-SRTP (and ZRTP) on the same
addresses and ports. (As an exception, allow the special MS
Multiplex TURN channel value.) Earlier versions of the specs
had these as unassigned (or did not support TURN Channels), and
no implementation has used them.

This prevents the STUN dissector from claiming RTP packets
going to the same port as set for STUN by Decode As, and should
allow us to set the STUN dissector as the dissector for a conversation
on UDP if we see any STUN message, not just a TURN message type.
2022-06-27 08:56:44 -04:00
Jo-Philipp Wich 1433104479 IEEE1905: fix IPv6 type TLV parsing
- Declare a separate type for the IPv6 TLV MAC address, otherwise its
   filter key is `ieee1905.ipv4_type.mac_addres` instead of the expected
   `ieee1905.ipv6_type.mac_addres` one which is confusing

 - Fix label for `hf_ieee1905_ipv6_type_count` to read "IPv6 address count"
   instead of the wrong "IPv4 address count"

 - Parse the IPv6 link local address which appears between the EUI-48 and
   the IPv6 address count in IPv6 type TLVs, without that, valid IPv6 TLVs
   are wrongly parsed and reported as malformed

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-06-27 11:47:57 +00:00
Dr. Lars Völker 2c9675b759 TECMP: fix typo 2022-06-27 11:31:35 +00:00
John Thacker dda4af1fc5 STUN: Update some comments 2022-06-26 15:03:23 -04:00
Gerald Combs b5e1e63dd0 [Automatic update for 2022-06-26]
Update manuf, services enterprise numbers, translations, and other items.
2022-06-26 17:40:36 +00:00
John Thacker cc52ef4d12 STUN: Fix MS-IMPLEMENTATION-VERSION value string
MS-IMPLEMENTATION-VERSION is not a duplicate of MS-VERSION, and
has a different interpretation. MS-VERSION is the version number
of MS-TURN, its values described in 2.2.2.17 of its spec, and
MS-IMPLEMENTATION-VERSION is the version of MS-ICE2, its values
described in section 3.1.5.2 of its spec.

The latter indicates whether the STUN message format must be that of
Internet-Draft behave-rfc3489bis-02 (that is, roughly the final
form of classic STUN, also used in MS-TURN) or whether that of
RFC 5389 is also supported.
2022-06-25 23:01:26 -04:00
John Thacker e49a69f361 HTTP: Add chunks as items instead of calling data dissector
HTTP chunked transfer encoding can have lots of chunks, and calling
the data dissector for each individual chunk adds a large number of
layers to the frame and doesn't really make sense. (As opposed to
calling the data dissector on the reassembled data if we can't handle
the content type, which does make sense.) In particular, this can
cause a failed assertion by adding more layers than
PINFO_LAYER_MAX_RECURSION_DEPTH.

Just add each data chunk as a FT_BYTES item. Fix #18130.
2022-06-25 20:28:10 +00:00
João Valverde efbe699756 dfilter: Remove STTYPE_RANGE_NODE
STTYPE_RANGE_NODE is just a lexical token, it is
not used withi the syntax tree so remove it.
2022-06-25 16:06:48 +01:00
João Valverde aaff0d21ae dfilter: Add layer support for references
This adds support for using the layers filter
with field references.

Before:
    $ dftest 'ip.src != ${ip.src#2}'
    dftest: invalid character in macro name

After:
    $ dftest 'ip.src != ${ip.src#2}'
    Filter: ip.src != ${ip.src#2}

    Syntax tree:
     0 TEST_ALL_NE:
       1 FIELD(ip.src <FT_IPv4>)
       1 REFERENCE(ip.src#[2:1] <FT_IPv4>)

    Instructions:
    00000 READ_TREE		ip.src <FT_IPv4> -> reg#0
    00001 IF_FALSE_GOTO	5
    00002 READ_REFERENCE_R	${ip.src <FT_IPv4>} #[2:1] -> reg#1
    00003 IF_FALSE_GOTO	5
    00004 ALL_NE		reg#0 != reg#1
    00005 RETURN

This requires adding another level of complexity to references.
When loading references we need to copy the 'proto_layer_num'
and add the logic to filter on that.

The "layer" sttype is removed and replace by a new
field sttype with support for a range. This is a nice
cleanup for the semantic check and general simplification.
The grammar is better too with this design.

Range sttype is renamed to slice for clarity.
2022-06-25 14:57:40 +01:00
João Valverde e9e6431d7b dfilter: Change boolean string representation
Use "True" or "TRUE" instead of "true" and remove case insensivity.
Same for false. This should serve to differentiate booleans a bit
more from protocol names, which should be using lower-case.
2022-06-25 13:02:34 +01:00
João Valverde 229dad6a75 X509IF: Fix duplicate filter name
Fixes #18155.
2022-06-24 21:10:45 +00:00
João Valverde 8793650707 dftest: Print ftype of protocol fields 2022-06-24 21:10:45 +00:00
João Valverde f1902c643e Regenerate ASN.1 dissectors 2022-06-24 21:10:45 +00:00
Gerald Combs 602e87d6c5 Make sure our Python scripts read and write UTF-8.
Explicitly set "encoding='utf-8'" for each of the files we read and
write in make-reg.py and generate_authors.py.
2022-06-24 11:08:37 -07:00
Moshe Kaplan 26f87b3250 wslua: Port epan/wslua/make-reg.py to Python3
Port the script that creates
declare_wslua.h and register_wslua.c
to Python3.
Ping #18152.
2022-06-24 15:02:38 +00:00
Jim Young a9bcbaf738 DNS: Note and dissect any extraneous payload bytes 2022-06-24 08:04:40 +00:00
Eelco Chaudron e79630f1d9 Frame: Fix segmentation dump when parsing packet_verdict
This change fixes a segmentation fault core dump in tshark/Wireshark
when loading a pcapng file that contains the packet verdict option.

This problem got introduced in the commit mentioned below.

Fixes: 030b06ba3c ("pcapng: write packet and Netflix custom blocks the same as other blocks.")
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
2022-06-24 00:02:29 +00:00
Thomas Vogt 95b01dc4bf GREbond: Add support for Huawei's GRE bonding (RFC8157) control protocol
This dissector is for the control messages of the GRE bonding protocol by
Huawei. These messages are encapsulated in GRE and can appear on both/all
bonding links.

During development, I made heavy use of traffic for Deutsche Telekom Hybrid
service. There fore, it also supports the first version which did not have an
IEEE assigned ethertype.
2022-06-23 19:40:25 +00:00
Dr. Lars Völker 181a7c7d7d Signal-PDU: Fix performance degradation on config switch
By adding signal aggregation the time to change profiles changed
dramatically. This is due to unregistering header fields being a very
slow operation and for aggregation each signal line did not lead to 2
but to 5 hfs.

Unregistering header fields for 150k signal example config (debug build):
- 3.6: 	 50s
- 3.7: 	592s (9:52!!!)

This patch brings the time back to 50s, if no aggregation is configured.
2022-06-23 19:24:17 +00:00
João Valverde d7322e757e epan: Use host byte order with AT_NUMERIC
Use host byte-order with AT_NUMERIC to make it more generic
and practical.

Change openSAFETY to pass addresses in host byte-order (the
previous code assumed they were in little-endian).

Plus a few cleanups.
2022-06-23 16:58:07 +01:00
Roland Knall 0079058837 openSAFETY: Define broadcast address globaly 2022-06-23 16:34:07 +02:00
Joerg Mayer 342af4727d Cisco Mis-Cabling Protocol: Support strict mode PDUs
Content of the new Type is still to be determined.
Also hack around an unsolved "mystery".
2022-06-23 12:09:10 +02:00
Roland Knall 4c768f54a7 epan: Make AT_NUMERIC behave more safely
Implement a better handling of byte sizes as well as preventing
possible memory bleeds

Fixes: 18147
2022-06-23 11:00:51 +02:00
Chuck Craft 39fc49b792 wsdg: escape tick marks after backtick; fix typo 2022-06-22 18:55:27 -05:00
Gerald Combs 3b0d9194bc Docs: Update the ftype description list in wireshark-filter(4).
Update a couple of ftype descriptions and update the list in the
wireshark-filter man page.
2022-06-21 14:33:45 -07:00
Pau Espin 4c22ff6bdb GTP: Several fixes and improvements to QoS IE GBR & MBR fields
The previous output was missing some fields under some conditions, and
some output text was wrong. This ended up in big confusion when looking
at the fields. Let's add the missing fields, fix the existing ones and
provide better formatting of the strings to understand which exact field
provides the info.
2022-06-21 18:35:30 +00:00
João Valverde 354e0d7edf dfilter: Add support for unicode escape sequences
Add support for entering unicode codepoints as \uNNNN or \uNNNNNNNN
for strings and charconsts (following the C standard).
2022-06-21 16:54:16 +01:00
João Valverde 47348ae598 dfilter: Add support for literal strings with null bytes
Before:
    Filter: frame matches "abc\x00def"
    dftest: \x00 (NUL byte) cannot be used with a regular string.
    	frame matches "abc\x00def"
    	                  ^~~~
    Filter: _ws.ftypes.string == "a string with a \0 byte"
    dftest: \0 (NUL byte) cannot be used with a regular string.
    	_ws.ftypes.string == "a string with a \0 byte"
    	                                      ^~

After:
    Filter: frame matches "abc\x00def"

    Syntax tree:
     0 TEST_MATCHES:
       1 FIELD(frame)
       1 PCRE(abc\0def)

    Instructions:
    00000 READ_TREE		frame -> reg#0
    00001 IF_FALSE_GOTO	3
    00002 ANY_MATCHES	reg#0 matches abc\0def
    00003 RETURN

    Filter: _ws.ftypes.string == "a string with a \0 byte"

    Syntax tree:
     0 TEST_ANY_EQ:
       1 FIELD(_ws.ftypes.string)
       1 FVALUE("a string with a \0 byte" <FT_STRING>)

    Instructions:
    00000 READ_TREE		_ws.ftypes.string -> reg#0
    00001 IF_FALSE_GOTO	3
    00002 ANY_EQ		reg#0 == "a string with a \0 byte" <FT_STRING>
    00003 RETURN

Fixes issue #16156.
2022-06-21 15:10:08 +00:00
João Valverde cbd3c44776 ftypes: Add FT_UINT_STRING to IS_FT_STRING() macro 2022-06-20 20:35:47 +01:00
João Valverde e42a4de47c ftypes: Fix an error message 2022-06-20 17:55:56 +00:00
João Valverde 0615ba6317 ftypes: Make accessor functions type safe 2022-06-20 17:29:57 +00:00
Andoni Diaz de Cerio 0cadfff04a MCPTT: Fix dissection of FC Reject Phase field
ETSI TS 24.380 section 8.2.3.4 specifies that:
"The <Reject Phrase> value is a text string encoded the text string
in the SDES item CNAME as specified in IETF RFC 3550."

This does not mean that SDES tipe and length files are necessary,
only applies in the enconding of the text string.
2022-06-20 15:24:00 +00:00
Martin Mathieson 17f5e15fcc DCT2000: call dissectors for R16 RRC 2022-06-20 11:16:18 +00:00
Orgad Shaneh 0bc756c2c0 TPNCP: Simplify size tracking
This also fixes a crash when tpncp.dat is missing the events part.
2022-06-19 17:26:40 +00:00
Gerald Combs 058fe0dd09 [Automatic update for 2022-06-19]
Update manuf, services enterprise numbers, translations, and other items.
2022-06-19 16:40:16 +00:00
Gerald Combs efe8dc051c Prefs: Change the default UI layout to type "2".
Make the default UI layout "packet list on top, packet detail and bytes
side by side". This is more space efficient on modern displays and is
the first thing I change when using the default profile.
2022-06-18 12:36:18 +00:00
John Thacker 41cd2fed9c BSSGP: Correct BBSGP -> BSSGP in a few places 2022-06-17 22:03:49 -04:00
John Thacker 9319394af1 MEGACO: Reset bracket counters after a Topology Descriptor
After parsing a Topology Descriptor at the start of a request
or reply command, reset the left and right bracket counters
before going back to the top of the loop to parse the next
command, just like how done at the end of the while loop with
a normal command.

Prevents marking as malformed packets which have a Topology Descriptor
followed by a single command (e.g. Move) without any trailing
descriptors, and hence no more left brackets.
2022-06-17 12:52:13 +00:00
Roland Knall 972a7950f2 openSAFETY: Adding conversation handler code 2022-06-17 13:23:52 +02:00
Roland Knall 300befc12a epan: Numeric address type
Add a numeric address type analog to StringZ for
protocols who only use numeric values as addresses
with no further handling.

e.g. IAT protocols which only enumerate the devices
2022-06-17 08:56:05 +00:00
John Thacker 3e012e2a87 epan: Finish converting endpoint_by_id to elements
Since the endpoint_by_id code uses elements and not the old
endpoint structure, it shouldn't set pinfo->use_endpoint to
TRUE when creating, and it should check if pinfo->conv_elements
is NULL, not pinfo->conv_endpoint.
2022-06-16 20:59:52 -04:00
Pascal Quantin 1bd24bb95d RTCP: ensure that at least two bytes are captured for heuristic checks
Fixes #18136
2022-06-16 03:28:31 +00:00
Dr. Lars Völker a159fe125e SIGNAL-PDU: Fixing memory leak in Signal List UAT 2022-06-16 02:59:10 +00:00
Gtker 60efc1a1c0 woww: Change SMSG_AUTH_RESPONSE result field size from 4 to 1
I somehow mistook the size of this field for a u32 instead of a u8
earlier.

vmangos clearly shows that it's a u8:
cd896d4371/src/game/World.cpp (L322)

and cmangos:
98a53ea30d/src/game/Server/WorldSession.cpp (L947)
2022-06-16 02:42:52 +00:00
Jeremy McCormick 9b08b02d8e a615a: don't parse exception timer if A1
Trying to parse LUS and LNS files if the protocol version
was "A1" led to them being marked as a malformed packets.
THis is because protocol version A1 LUS and LNS files do
not have the exception timer field. So to fix it, we check if
the protocol version is not A1, and only if it isn't do we try to
parse the exception timer field.
2022-06-16 02:29:37 +00:00
Gerald Combs 572e6b0c10 Docs: Add some protocols to the release notes. 2022-06-15 11:49:40 -07:00
Adrian Granados a664d29978 ieee80211: Update reason codes as in IEEE Std 802.11-2020 and 802.11ax-2021 2022-06-15 07:06:35 +00:00
Chuck Craft 208cf56b75 ip: ip.flags field are 3 high bits not full byte
See https://ask.wireshark.org/question/27546/0x01-flag-on-last-of-fragmented-packets/
2022-06-14 20:28:17 +00:00
John Thacker f1cbc6b662 epan: Remove fragment_get_reassembled()
Because completed reassemblies are hashed in the reassembled_table for
all the frame numbers that contributed fragments,
fragment_get_reassembled_id() works wherever fragment_get_reassembled()
does, and also works where the fragment id is not the frame number.

However, since the reassembled_table hash key only depends on the
fragment id and the frame number, it only allows a frame to have
one reassembly with a given fragment id. Some protocols can have
more than one reassembly with a given fragment id (that differ on
addresses or other keys), such as GSM SMS, and the wrong reassembly
is retrieved on the second pass in those cases.

For this reason, we might want to add additional key elements to
reassembled_table, such as layer number. fragment_get_reassembled_id
already takes packet_info as a parameter and can accommodate that
without further changes, but fragment_get_reassembled cannot, so
remove the latter in favor of the former.
2022-06-14 00:59:34 +00:00