Commit Graph

44935 Commits

Author SHA1 Message Date
Gerald Combs 429c7a6ce3 epan: Don't free epan-scoped memory.
e6a8318f18 allocated our element list map key in epan scope. Don't try
to free it.
2022-05-31 10:31:22 -07:00
Gerald Combs e8dc20899f epan: Remove conversation_create_endpoint options.
The "options" paramameter was never used, so remove it.
2022-05-29 18:00:09 -07:00
Gerald Combs 48ff21b573 [Automatic update for 2022-05-29]
Update manuf, services enterprise numbers, translations, and other items.
2022-05-29 17:20:25 +00:00
John Thacker 6fd1c08a3a TCP: Don't add [TCP segment of a reassembled PDU] to the second PDU
When desegmenting, don't add [TCP segment of a reassembled PDU] to
the INFO column if we've already dissected a complete PDU in this
frame. This is for the same reasons that we set a fence in the INFO
column and set the PROTOCOL column to be not writable. It's not
of particular interest that this frame also contains the start of
a new PDU when the INFO column has information about a complete
higher level PDU. The information about the other PDU is contained
in the tcp tree elements.

Fix #15494
2022-05-29 11:42:17 -04:00
John Thacker ec12d0c530 TCP: Report reassembled in for more PDUs where we know it
In the case where the beginning of a TCP segment does not continue
a higher-level PDU, but the end of the segment is the beginning of
another PDU, we don't need to create the MSP for the second PDU
after the first time we visit the packet. However, we do want to
retrieve that MSP for determining in which frame the second PDU
was reassembled.

Make "Reassembled PDU in frame:" messages be added in that case
like it already is for other frames with MSPs.
2022-05-29 10:59:55 -04:00
John Thacker 717e4c47ee TCP: reset addresses and ports after each segment
TCP can contain multiple PDUs of the next layer protocol, and the
subdissector (or further subdissectors called from it) can change
the addresses and ports. However, the addresses and ports are used
for the desegmentation tables at the TCP level, as well as for
various purposes in encapsulated protocols.

Restore the addresses and ports values of packet_info before each PDU,
and in desegment_tcp after returning from a subdissector. When leaving
desegment_tcp ensure that the addresses and ports are set to whatever
they were after the last subdissector call that successfully
desegmented a PDU.

Fix #2345. Fix #9782.
2022-05-28 20:41:52 -04:00
John Thacker 95ba1151df TCP: Handle additional data requested with ooo reassembly
The test for "old_len" with a reassembled MSP has never been accurate
for out of order reassembly, where it caused additional data requested
to be taken from the end of the current frame instead of from the
correct portion of the reassembled MSP, which could be from an
out of order frame (later in sequence, but arrived earlier.)

The test is unnecessary - the other case, where we need more data
but there's more in the current frame is already handled by looping again.

This fixes reassembly where TCP is out of order and those out of order
segments don't align on PDU boundaries. Fix #13317.

Also fix a minor issue in the same situation where the length of the
current segment was indicated incorrectly for out of order frames
contributing to multiple MSPs.
2022-05-28 21:40:19 +00:00
Martin Mathieson 17322b0cc2 Make a couple of functions static. 2022-05-28 20:35:58 +01:00
Dana Sy cba61d08f8 Zigbee: Touchlink typo
Fixed typo for Touchlink command filter name
2022-05-28 09:09:43 +00:00
Dana Sy 7df725a119 Zigbee: Touchlink missing info field
Added in the profile interop bit for the Touhlink information field.
2022-05-28 09:09:43 +00:00
Uli Heilmeier 083c6828f5 EOBI: Disable dissector by default
The EOBI dissector has no heuristic and is using several nonstandardized
high ports. Therefore disabling it by default.

Fixes #18103
2022-05-27 19:04:59 +00:00
Uli Heilmeier 9fa0d711f6 O-RAN: Fix offset extension 10 and beam vector list
Increment offset and use numPortc for number of beam vector list items

Fixes: #18116
2022-05-27 18:47:49 +00:00
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 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 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
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 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
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 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
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 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
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
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 aad47c8438 RLC-NR: When have NACK Range, clearly show which SNs were lost 2022-05-20 16:17:04 +01:00
Brian Sipos e47ab95e46 BPv7 and TCPCL: Update references to published RFCs 2022-05-19 20:15:59 -04:00
Gerald Combs 1bfa15f7de epan: Document the epan, file, and packet scopes. 2022-05-18 21:08:05 +00:00
lindnerp 7079d881fa Update bpv7 and bpsec dissectors to resolve ticket 17727 2022-05-18 12:48:41 -04:00
easonweii 148f5905af SDP: Minor Refactoring by Extract Method
Extract Method for multiple message of SDP Media Attribute to simplify things and Make processes clearer.
dissect_sdp_media_attribute_rtpmap
dissect_sdp_media_attribute_fmtp
dissect_sdp_media_attribute_path
dissect_sdp_media_attribute_h248_item
dissect_sdp_media_attribute_crypto
The original function remain unchanged.
2022-05-18 08:29:37 +00:00
Jason Cohen 44433d3c9c f5ethtrailer: Decode TLS 1.3 trailer info on some versions 2022-05-18 08:28:57 +00:00