Commit Graph

84342 Commits

Author SHA1 Message Date
João Valverde cd73921a9e lrexlib: Disable a warning [-Wshorten-64-to-32]
The warning is harmless and we want to keep upstream code
as pristine as possible (unless there is a real issue in
the code of course) so disable the warning.
2022-05-27 15:14:16 +01:00
Gerald Combs 370c58f913 macOS: Add Logwolf packaging targets.
Rename the following build targets:

app_bundle to wireshark_app_bundle
dmg_package_prep to wireshark_dmg_prep
dmg_package to wireshark_dmg

Add logwolf_app_bundle, logwolf_dmg_prep, and logwolf_dmg targets and
packaging assets. Update the documentation.

We need to add a set of Logwolf version variables to CMake and
make-version.pl. Add a static logwolf-version attribute to
attributes.adoc in the mean time.
2022-05-26 20:29:20 +00:00
Gerald Combs 5373483963 Tools: Add a CMakeExecutable parameter to win-setup.ps1.
52054046c1 switched archive extraction from 7Zip to CMake. This removed
a dependency on 7Zip, but assumed that CMake was in our PATH.  Add a
CMakeExecutable to win-setup.ps1 and use it in CMakeLists.txt to pass
the value of CMAKE_COMMAND.
2022-05-26 20:13:18 +00:00
Gerald Combs e6a8318f18 epan: Fix our conversation key lifetimes.
wmem_map doesn't copy keys, so we need to keep them around.
2022-05-26 11:28:21 -07:00
João Valverde b8279a6ce1 lrexlib: Pacify checkAPIs 2022-05-26 10:09:13 +00:00
João Valverde 8ff24c2b6e Lua: Add lrexlib-pcre2 Lua regex bindings
Add the de facto standard Lua regex API to Wireshark. Upstream
code is copied verbatim and the module opened in the "rex" table.
This is just a user convenience and developer quality of life improvement
over the GRegex Lua API because it has always been possible to
load lrexlib-pcre2 as a Lua module from Wireshark.
2022-05-26 10:09:13 +00:00
João Valverde e6da2cd8de Lua: Remove on-life-support GRegex bindings
This code has been unmaintained and does not pass the lrexlib test
suite. GRegex itself has been obsolescent for some time, although GNOME
has recently restarted trying to move it to PCRE2.

Remove it in preparation for a move to lrexlib-pcre2.
2022-05-26 10:09:13 +00:00
John Thacker 7ab343e7d6 tcp: Split MSPs in out of order processing
When processing segments out of order in TCP, it is possible to
get new segments that fill a sequence gap and be able to dissect
at least one PDU but need more data for additional PDUs (that have
data from the contiguous stream bytes.) We can only determine this
after passing the reassembled segments to the subdissector first.

To keep dissection and layer numbers consistent between passes,
split the multisegment PDU, keeping the already dissect PDU(s) in
the current reassembly and creating a new MSP for the parts not yet
dissected.

Update the dissection test to enable the currently skipped test that
require MSP splitting and remove test_tcp_out_of_order_twopass_with_bug
2022-05-26 00:49:16 +00:00
João Valverde ab33d9b809 Qt6+MSYS2: Fix windeployqt usage
The msys2 qt6 package installs windeployqt as windeployqt-qt6.
2022-05-25 23:46:23 +01:00
João Valverde ee7094d34c CMake: Fix typo 2022-05-25 23:46:01 +01:00
João Valverde 9c86d22e5b MSYS2: Fix compilation error 2022-05-25 23:45:32 +01:00
Gerald Combs 34d74031a9 epan+Qt: Add element tables to the ConversationHashTablesDialog.
Add get_conversation_hashtables() and use it to populate the
conversation hash tables dialog.
2022-05-25 19:09:12 +00:00
Alexis La Goutte 966969e777 conversation(.h): Fix -Wdocumentation 2022-05-25 18:53:48 +00:00
Tomasz Moń 1a60de0b76
USB: Sanitize USB 2.0 endpoint max packet size
Introduce Wireshark specific enum to facilitate USB speed specific
dissection. Any similarity of actual enum values with any protocol
is coincidence and should not be relied upon.

Rename speed defines in USBIP dissector to not collide with Wireshark
USB speed enum. The values used in USBIP are implementation specific.

Allow user to set capture speed in USBLL dissector preferences. Use the
selected speed in USB dissector to sanitize endpoint maximum packet size
value based on speed specfic requirements from USB 2.0 specification.

Close #18062
2022-05-25 20:26:24 +02:00
Gerald Combs aef4c0c60a epan: Allocate a conversation key.
Blind attempt at fixing #18113.
2022-05-25 10:38:36 -07:00
Gerald Combs 19e1764ca5 epan: Lazily create conversation dissector trees.
Create our dissector tree maps only when we need them.
Fixes #18109.
2022-05-25 09:40:55 -07:00
Joakim Karlsson 7a59f8a22c gprscdr: Update to 3GPP TS 32.298 V17.2.0
Only documentation changes, no new c file is generated
2022-05-25 13:56:21 +02:00
Martin Mathieson 0188c9a1da ORAN FH-CUS: Section type 5 has ef field. 2022-05-25 07:19:53 +00:00
John Thacker 485aedf4e1 tap-iostat: Make a bunch of ints unsigned
Almost all the ints in tap-iostat are loop counters, numbers of columns
or rows, durations, lengths, widths, or magnitudes, all things that are
inherently unsigned. Make them unsigned.

This has the incidental effect of fixing an odd alloc-size-larger-than
error with gcc 12.1, which is afraid that if borderlen is signed that
g_malloc will somehow be called with value -1 (18446744071562067969):

Fix #18089
2022-05-24 20:27:04 -04:00
Gerald Combs c0032f2f0d epan: Switch the conversation IDs back to guint32s.
Switch the _by_id IDs back to guint32s. None of the current callers need
64 bits and if someone needs 64-bit IDs they can use conversation_new_full.
2022-05-24 12:07:48 -07:00
Gerald Combs 286aec2436 Tools: Clean up win-setup.ps1's CleanupItems
Remove some items from CleanupItems that are no longer relevant.
2022-05-24 18:15:00 +00:00
Gerald Combs f065fdbc63 Windows: Upgrade zstd to 1.5.2. 2022-05-24 17:51:31 +00:00
Gerald Combs 865feb2bf8 epan: Switch some _by_id conversation routines to elements.
Switch the non-endpoint *_by_id conversation routines to use element
lists. Change the ID type from guint32 to guint64. None of them used the
address+port option flag arguments, so remove them.
2022-05-24 17:18:21 +00:00
Gerald Combs e5fc7c1d83 Tools: Switch to a new Windows development library repository.
Download our third party libraries and drivers from dev-libs.wireshark.org
in win-setup.ps1. Automatically check our state based on our library
filenames and hashes instead of a manually updated tag.
2022-05-24 16:53:49 +00:00
Martin Mathieson f3db612fa1 PDCP-NR: Fix a test (flagged by coverity) 2022-05-24 16:59:29 +01:00
Anders Broman 8be21c7867 SIP: Add a filter for VIA parameter be-route 2022-05-24 14:41:42 +00:00
Anders Broman e6c4557c0b SIP: Handle short frame in dissect_sip_sec_mechanism() 2022-05-24 13:10:01 +02:00
Martin Mathieson 20b311e7a9 PDCP-NR: Add separate UL/DL expert info ei items for missing SNs 2022-05-24 08:07:10 +00:00
João Valverde 66506483bf Minor release notes clean up
Add a new item about field references and reorganize the
list roughly by relevance.
2022-05-24 01:35:23 +01:00
João Valverde 94fe2b195c Try to fix some warnings.
[1638/2312] Building C object epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o
FAILED: epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o
/usr/bin/ccache /usr/bin/cc -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DWS_BUILD_DLL -I. -I../ -I../include -Iepan/ftypes -I../epan/ftypes -I../epan -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -fvisibility=hidden  -fexcess-precision=fast -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wredundant-decls -Wno-error=maybe-uninitialized -Wno-format-truncation -Wframe-larger-than=32768 -fdiagnostics-color=always -Wunused-const-variable -Wshadow -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-init -Werror=implicit -Wno-pointer-sign  -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -O2 -g -DNDEBUG -fPIC   -std=gnu11 -Werror -MD -MT epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o -MF epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o.d -o epan/ftypes/CMakeFiles/ftypes.dir/ftype-protocol.c.o   -c ../epan/ftypes/ftype-protocol.c
../epan/ftypes/ftype-protocol.c: In function ‘_tvbcmp’:
../epan/ftypes/ftype-protocol.c:248:62: error: operand of ?: changes signedness from ‘int’ to ‘guint’ {aka ‘unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
  248 |  guint a_len = a->length < 0 ? tvb_captured_length(a->tvb) : a->length;
      |                                                              ^~~~~~~~~
../epan/ftypes/ftype-protocol.c:249:62: error: operand of ?: changes signedness from ‘int’ to ‘guint’ {aka ‘unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
  249 |  guint b_len = b->length < 0 ? tvb_captured_length(b->tvb) : b->length;
      |                                                              ^~~~~~~~~
../epan/ftypes/ftype-protocol.c: In function ‘slice’:
../epan/ftypes/ftype-protocol.c:224:60: error: argument ‘length’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
  224 | slice(fvalue_t *fv, GByteArray *bytes, guint offset, guint length)
      |                                                      ~~~~~~^~~~~~
cc1: all warnings being treated as errors
2022-05-23 23:04:07 +01:00
João Valverde 51de43cfd2 dfilter: Fix protocol slices with negative indexes
Field infos have a length property that was not stored with the
field value so when using a negative index the end was computed
from the captured length of the frame tvbuff, leading to incorrect
results. The documentation in wireshark-filter(5) describes how
this was supposed to work but as far as I can tell it never worked
properly.

We now store the length and use that (when it is different from -1)
to locate the end of the protocol data in the tvbuff. An extra wrinkle
is that sometimes the length is set after the field value is created.
This is the most common case as the majority of protocols have a
variable length and dissection generally proceeds with a TVB subset from
the current layer (with offset zero) through all remaining layers to the
end of the captured length. For that reason we must use an expedient to allow
changing the protocol length of an existing protocol fvalue, whenever
proto_item_set_len() is called.

Fixes #17772.
2022-05-23 23:04:07 +01:00
João Valverde ce52af1a32 CMake: Disable errors with -Walloc-size-larger-than=
This seems to be buggy and have a complicated interaction with
the GCC optimizer. Disable hard failures so we can focus on
actual issues and deal with dormant false positives when it is
convenient.

Ping #18089
2022-05-23 23:03:59 +01:00
Gerald Combs f6fdf53eca epan: Consolidate some duplicate conversation code.
Rename conversation_lookup_hashtable to conversation_lookup_addr_port.
Add a new conversation_lookup_hashtable that consolidates some duplicate
code and takes a general set of arguments similar to the other
conversation_*_hashtable routines.
2022-05-23 13:57:08 -07:00
Gerald Combs b4376b4533 Git+docs: Ignore and document CMakeListsCustom.txt. 2022-05-23 20:19:15 +00:00
Gerald Combs be929e162d epan: Allow conversations based on arbitrary element lists.
Add conversation_new_full and find_conversation_full, which take
arbitrary element lists instead of fixed addresses and ports.

Update the comments in conversation.h to be more Doxygen-conformant.
Update README.dissector.

Use the new functionality to add initial conversation support to the
Falco Bridge dissector.
2022-05-23 18:12:26 +00:00
Dr. Lars Völker 96cf14ea01 TECMP: Renaming to Device and Interface for TECMP 1.7
The new TECMP release renames as follows:
- Capture Module -> Device
- Channel -> Interface

Header fields (incl. filters) and Config UATs are affected.
2022-05-23 17:07:03 +00:00
John Thacker 75f31638f2 Apply 1 suggestion(s) to 1 file(s) 2022-05-23 16:27:18 +00:00
Gerald Combs 349787051e CMake+Qt: Fix our Resource Compiler arguments.
We pass "--format-version 1" to rcc. If it's compiled with Zstandard we
need to pass "-compress-algo zlib" as well.
Fixes #18100.
2022-05-23 16:27:18 +00:00
John Thacker e1a6913a2b qt: Ignore gcc 12.1 optimization bug with Qt
The Qt implicit casts from QByteArray to QString all use
size = -1, meaning to the end of the string.

This causes gcc 12.1 with -O2 to produce a very dubious stringop-overread
warning, by computing both sides of a branch even when it shouldn't:

/usr/include/qt5/QtCore/qstring.h:706:69: error: ‘size_t strlen(const char*)’ reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  706 |         return fromUtf8_helper(str, (str && size == -1) ? int(strlen(str)) : size);
      |                                                               ~~~~~~^~~~~

There's also a similar error with QByteArray.constData(), even though
isEmpty() should return True when the QByteArray is NULL.
(Adding isNull() prevents the warning but is redundant.)

Use DIAG_OFF and DIAG_ON to ignore the warning on GCC 12.1 and higher.
Fix #18090.
2022-05-23 12:14:03 +00:00
Martin Mathieson 87d0c6f492 Some check_typed_item_calls.py warning fixes. 2022-05-22 21:48:54 +00:00
Gerald Combs c8fc8de3d4 [Automatic update for 2022-05-22]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2022-05-22 16:37:34 +00:00
Gerald Combs 2f0b5ab2cb Tools: Remove 32-bit support from win-setup.ps1. 2022-05-22 15:46:13 +00:00
Dr. Lars Völker bc57219e46 TECMP: Update to TECMP 1.7 specification
This patch updates the TECMP dissector with 1.6 and 1.7 changes.

Changes:
- Multiple new flags for CAN, CAN-FD, FlexRay, LIN, Analog, etc.
- Reordering of flags
- Additional data units for Analog
- New Header CRC and Frame CRC for FlexRay (1.6 change)
- New CRCs for CAN and CAN-FD (1.6 change)
- Deprecated the removed Analog Threshold Undershot/Exceeded flags,
  since they were removed

This patch does not include the renaming to Device and Interface.
2022-05-22 08:54:02 +00:00
Alexis La Goutte bc7c41c820 smc: fix clang analyzer warning (Dead.Store)
packet-smc.c:722:4: warning: Value stored to 'offset' is never read [deadcode.DeadStores]
packet-smc.c:887:4: warning: Value stored to 'offset' is never read [deadcode.DeadStores]
2022-05-22 08:40:44 +00:00
Alexis La Goutte f6dda3c116 couchbase: fix clang analyzer warning (Dead.Store)
packet-couchbase.c:2685:17: warning: Value stored to 'offset' is never read [deadcode.DeadStores]
2022-05-22 08:40:44 +00:00
Alexis La Goutte 406f5263c3 catapult-dct200: fix clang analyer warning (Dead.Store)
packet-catapult-dct2000.c:1099:13: warning: Value stored to 'tag' is never read [deadcode.DeadStores]
packet-catapult-dct2000.c:1100:13: warning: Value stored to 'len' is never read [deadcode.DeadStores]
packet-catapult-dct2000.c:3076:21: warning: Value stored to 'sub_dissector_result' is never read [deadcode.DeadStores]
2022-05-22 08:40:44 +00:00
Alexis La Goutte 8ee1eabeee dfvm(dfilter): fix clang analyzer warning (Dead.Store) 2022-05-22 08:40:44 +00:00
Martin Mathieson 17367e4648 check_typed_item_calls: skip mask checks if can't parse 2022-05-21 19:54:13 +00:00
Matthias Dietrich 7b53720999 Use proto_tree_add_item where possible 2022-05-21 07:52:07 +00:00
Matthias Dietrich cc4223f537 Add PA Profile 4.02 diagnostics codes 2022-05-21 07:52:07 +00:00