Commit Graph

45811 Commits

Author SHA1 Message Date
John Thacker ab27562dbc Fixup fragment
Fix a fragment idiom changed in 4f3b028d94

Fix #18634
2022-11-14 12:22:37 +00:00
David Perry 52382b2592 Use `register_dissector()` for more protocols 2022-11-14 04:48:24 +00:00
John Thacker 4f3b028d94 epan: Separate fragment_head and fragment_item
Separate fragment_head and fragment_item into two
different types of structs.

Remove "offset" from fragment_head, which was unused,
making fragment heads 4 bytes smaller.

Remove fragment_nr_offset, datalen, reassembled_in,
reas_in_layer_num, and error from fragment_item,
making them 24 bytes smaller.

Change a few dissectors which were using fragment_head
and fragment_item indistinguishably.

Ping #17311
2022-11-14 01:18:11 +00:00
Gerald Combs 0bfdd0d954 [Automatic update for 2022-11-13]
Update manuf, services enterprise numbers, translations, and other items.
2022-11-13 18:12:27 +00:00
Kevin Albertson 24d55ce7ac move depth increment below error checks 2022-11-13 16:19:19 +00:00
Kevin Albertson 2b43f5f650 mongo: fix document depth tracking
Fixes a "BSON document recursion exceeds" error on lists of > 100
documents.
2022-11-13 16:19:19 +00:00
João Valverde ae0c38a07a NFS: Fix string decoding to use UTF-8
Use tvb_get_string_enc() to read a string.

I think NFSv3 doesn't specify an encoding so interoperabilty
is dicey. I believe NFSv4 specifies UTF-8.

Fixes #18628.
2022-11-13 15:38:53 +00:00
Martin Mathieson fd96d818a9 SAP HDB: fix a spelling error and some cppcheck warnings 2022-11-12 11:30:26 +00:00
John Thacker 3014fd9d17 pgsql: Avoid crash on non-ASCII invalid type bytes
We don't really want to a full hex representation to the INFO
column, just replace it for unprintable characters.

Fix #18591
2022-11-11 17:45:26 -05:00
Martin Gallo 384bf49591 SAPHDB: Added SAP HDB as main dissector 2022-11-11 13:10:00 +00:00
Chuck Craft 1e6f26adb6 wslua: init.lua - superuser logic; typeof() call on non-table
obj.__typeof exists only for "table" objects (see c4f1777a)
2022-11-10 07:32:30 -06:00
Chuck Craft b032a40fd9 IEEE 802.11: random addresses in conversations and endpoints
https://ask.wireshark.org/question/29235/
MAC addresses shown in WLAN statistics do not appear in the capture!

Initialize the address types then check if set when tapping.
2022-11-10 12:22:31 +00:00
Cody Planteen c34223ad62 VRT: add context packet support to VITA 49 dissector
Add complete decoding of CIF0 context packet fields per ANSI/VITA 49.2-2017
standard. Includes framework for future CIF1-CIF3 support with partial
implementation of CIF1.
2022-11-10 06:38:22 +00:00
John Thacker f9a5bf5805 WASSP: Don't add a NULL to a column
The result of try_val_to_str can be NULL, don't add a null address
to a column. Ensure that an appropriate unknown string is added
instead.

Fix #18613
2022-11-09 20:38:45 -05:00
Huang Qiangxiong 99e93e24b8 Protobuf: fix the bug about string format
Support string format like:
- 'a single quote string contains "a double quote string"'
- "a double quote string contains 'a single quote string'"

close #18599
2022-11-09 16:11:22 +00:00
Pascal Quantin 2a0061e445 EVS: improve info column display 2022-11-09 16:46:24 +01:00
Pascal Quantin 1196f214aa EVS: add an option to force decoding as Header-Full format only
Closes #18498
2022-11-09 16:12:17 +01:00
Alexis La Goutte 7f2006e744 ieee80211: Use FT_STRING for HS 2.0 OSU NAI
Fix 18610
2022-11-09 11:41:21 +00:00
Gerald Combs 85357ae721 Fix more unused variables and enable unused-but-set-variable errors.
Add -Werror=unused-but-set-variable to our default compiler flags and fix

```
epan/dissectors/packet-dcerpc-frsrpc.c:709:10: error: variable 'nb_chunk' set but not used [-Werror,-Wunused-but-set-variable]
        guint32 nb_chunk = 0;
                ^
```

```
epan/dissectors/packet-dcom-oxid.c:175:13: error: variable 'u32ItemIdx' set but not used [-Werror,-Wunused-but-set-variable]
    guint32 u32ItemIdx;
            ^
```

```
epan/dissectors/packet-l2tp.c:1775:104: error: parameter 'ccid' set but not used [-Werror,-Wunused-but-set-parameter]
static int dissect_l2tp_ericsson_avps(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 ccid)
                                                                                                       ^
```

```
epan/dissectors/packet-ldp.c:1922:19: error: variable 'ix' set but not used [-Werror,-Wunused-but-set-variable]
    guint8        ix;
                  ^
```

```
epan/dissectors/packet-nas_5gs.c:4757:14: error: variable 'curr_len' set but not used [-Werror,-Wunused-but-set-variable]
    guint i, curr_len;
             ^
```

```
epan/dissectors/packet-per.c:1769:6: error: variable 'extension_addition_entries' set but not used [-Werror,-Wunused-but-set-variable]
        int extension_addition_entries;
            ^
```

```
epan/dissectors/packet-rtitcp.c:618:11: error: variable 'messages_count' set but not used [-Werror,-Wunused-but-set-variable]
    guint messages_count, offset;
          ^
```

```
epan/dissectors/packet-tcp.c:2130:9: error: variable 'ackcount' set but not used [-Werror,-Wunused-but-set-variable]
    int ackcount;
        ^
epan/dissectors/packet-tcp.c:3317:12: error: variable 'nbOptionsChanged' set but not used [-Werror,-Wunused-but-set-variable]
    guint8 nbOptionsChanged = 0;
           ^
```

```
epan/dissectors/packet-zbee-zcl-se.c:11802:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
    for (gint i = 0; tvb_reported_length_remaining(tvb, *offset) >= 5; i++) {
              ^
```

```
ui/iface_lists.c:142:23: error: variable 'linktype_count' set but not used [-Werror,-Wunused-but-set-variable]
    gint              linktype_count;
                      ^
```

```
ui/voip_calls.c:456:15: error: variable 'item_num' set but not used [-Werror,-Wunused-but-set-variable]
    guint     item_num;
              ^
```

```
file.c:572:17: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
        guint32 count             = 0;
                ^
```

```
file.c:3667:24: warning: cast from 'const unsigned char *' to 'unsigned char *' drops const qualifier [-Wcast-qual]
        pd = (guint8 *)ws_mempbrk_exec(pd, buf_end - pd, pattern, &c_char);
                       ^
```

```
ui/qt/io_graph_dialog.cpp:1932:60: error: variable 'mavg_right' set but not used [-Werror,-Wunused-but-set-variable]
    unsigned int mavg_in_average_count = 0, mavg_left = 0, mavg_right = 0;
                                                           ^
```

```
ui/qt/stats_tree_dialog.cpp:166:9: error: variable 'node_count' set but not used [-Werror,-Wunused-but-set-variable]
    int node_count = 0;
        ^
```

```
ui/qt/models/profile_model.cpp:1142:13: error: variable 'entryCount' set but not used [-Werror,-Wunused-but-set-variable]
        int entryCount = 0;
            ^
```
2022-11-08 13:49:44 -08:00
Gerald Combs b662f565f0 STP: Remove an unused variable.
Fix

```
epan/dissectors/packet-bpdu.c:327:36: error: variable 'msti' set but not used [-Werror,-Wunused-but-set-variable]
  int   total_msti_length, offset, msti, msti_format;
                                   ^
```
2022-11-08 08:54:16 -08:00
John Thacker 526ccef5f4 per: Implement UTF8String properly
UTF8String is not a known-multiplier character string, since the
characters are variable width. That means that a size constraint
in characters doesn't correspond to a fixed number of octets, and
thus that constraints are never PER-visible. (X.691 27.6) That
includes size constraints, extensions, permitted alphabets, etc.
The length determinant is thus the unconstrained type, and always
at least an entire octet instead of ever taking up a smaller
number of bits.

Extract the string as UTF-8 after aligning as necessary, which
will deal with illegal encodings.

Fix #18600.
2022-11-08 07:05:42 -05:00
Dario Lombardo c2b59567d3 tshark: update man to explain why some fields are skipped in elastic-mapping. 2022-11-08 06:24:50 +00:00
John Thacker 3ec1e6ca59 afs: Validate vectorized strings
The RXStringV type has one character (octet) stored per 32
bit word. There's no real indication of the string encoding
(possibly locale dependent, maybe ASCII or UTF-8.) Validate
it as UTF-8 for now, to produce good UTF-8 and handle the latter
two cases.

Fix #18583.
2022-11-07 09:36:52 +00:00
Peter Wu df478a365d dfilter: treat carriage returns as whitespace
Fixes #18595
2022-11-07 01:00:50 +00:00
Gerald Combs 0bfe5bed72 [Automatic update for 2022-11-06]
Update manuf, services enterprise numbers, translations, and other items.
2022-11-06 17:57:36 +00:00
Pascal Quantin a1feafad6c IPv6: fix embedded IPv4 address dissection when using Well-Known Prefix
See https://www.wireshark.org/lists/wireshark-dev/202211/msg00000.html
2022-11-06 16:57:59 +01:00
Martin Gallo 0562fe46f6 SAPIGS: Added SAP IGS as main dissector 2022-11-06 14:27:25 +00:00
John Thacker 23f54390f1 hl7: Validate encoding
Translate the raw strings from the struct from ASCII before adding
to the columns.

Fix #18598
2022-11-06 06:23:45 -05:00
John Thacker 9a3d091933 mmse: Handle encoding
Use tvb_get_stringz_enc with ENC_ASCII instead of tvb_strsize
and tvb_memdup. Note that, in MMS encoding at least,
OMA-TS-MMS-CONF says that Text-string (where encoding is
not specified) is always US-ASCII.

For Encoded-string-values, get and process the MIBEnum charset,
at least when it's an integer (which OMA-TS-MMS-CONF says it
must be.)

Fix #18575
2022-11-06 05:29:56 -05:00
Michael Tuexen bcbd6c3974 sctp: add support for Zero Checksum Acceptable parameter 2022-11-05 20:27:36 +00:00
John Thacker d2f7b8907c wbxml: Fix encoding
Whenever a string is inline or retrieved from the string table,
it needs to use the document encoding. Not tvb_format_text
(which always assumes UTF-8, though that is the default for WBXML
if we don't know otherwise), and *definitely* not tvb_get_ptr.

Replace a bunch of calls of tvb_strsize and tvb_format_text
(and one tvb_get_ptr) with tvb_get_stringz_enc with the
document encoding, which is now stored in packet level proto
data. (There should be a fallback to parsing it from the
Content-Type string, if the calling dissector provides it.)

Fix #18573
2022-11-05 15:02:16 +00:00
Martin Mathieson 07627f0230 E2AP: peek at RAN function name using tvb_get_stringz_enc 2022-11-05 12:27:44 +00:00
John Thacker f47f114bb2 skinny: Check encoding
The displayLabel type in SCCP (skinny) is ASCII where certain
bytes are replaced with common phrases from a codebook. When
displaying the replaced string, remember to replace the non
ASCII characters with REPLACMENT CHARACTERS.

Fix #18592
2022-11-03 21:36:15 -04:00
John Thacker 73c291029d skinny: Resync xml code with dissector, regenerate
Make changes to packet-skinny.c.in and SkinnyProtocolOptimized.xml
that incorporate changes from 67f05835ca
and 8efad466c4 made to the dissector
manually and regenerate. Also fix a case where a comment mixed
tabs and spaces, which caused the python conversion tool to complain.
2022-11-03 20:55:05 -04:00
Pascal Quantin 1505fa1b4b addr_resolv: define default port values for DNS resolution UAT
This ensures forward compatibility when using Wireshark 4.x or later
(see #18214)
2022-11-03 12:19:00 +00:00
John Thacker 5fa07d18ec xcsl: Check encoding of characters
Separate the tokens in xcsl using tvb_ws_mempbrk_pattern_guint8
instead of the dissector doing it manually.
Retrieve the ASCII token strings with tvb_get_string_enc to do
conversion to UTF-8.

Fix #18587
2022-11-03 07:19:46 -04:00
Martin Mathieson 49d21db1a7 DBUS: Make a function static 2022-11-03 11:17:56 +00:00
Pascal Quantin 798c1a8e6d EVS: fix frame format detection heuristics
As stated in 3GPP 26.445 chapter A.2.2.1.4.2, RTP padding must be taken
into account to discrimate between Header-Full format and Compact format

Closes #18498
2022-11-03 10:23:40 +00:00
John Thacker df4a0f289c alljoyn: Use a FT_CHAR and value_string for the type id
The type id is a natural FT_CHAR, which is much easier than
using a custom formatting function. This also avoids creating
bogus UTF-8

Fix #18582.
2022-11-02 21:44:36 -04:00
John Thacker 3e0ee841b1 epan: Simplify construct_match_selected_string
Since fvalue_to_string_repr does take the field base
as a parameter and that affects the representation,
an existing comment is no longer true, and we can
get rid of a large amount of duplicative special
handling for integer-based types.
2022-11-02 18:16:59 -04:00
Martin Mathieson 3ac86775dc Fix some spelling errors 2022-11-02 20:54:24 +00:00
John Thacker e449b560c0 epan: Properly generate filter expressions for custom columns
Properly generate filter expressions for custom columns by
using proto_construct_match_selected_string on each value and
then joining them together later instead of trying to split
the column expression value.

This ensures that escaping is done properly for display filter
strings, that commas internal to field values are not confused
with commas between occurrences, that for multifield columns
we can distinguish which field each value matches, etc.

It's not entirely clear whether AND or OR logic is appropriate
for multiple occurrences; currently OR is used.

Bump glib requirement to 2.54 for g_ptr_array_find_with_equal_func
(this doesn't drop support for any major distribution that already
meets our other library requirements, like Qt.)

Fix #18001.
2022-11-02 19:46:11 +00:00
Martin Mathieson c6a0b9b64a E2AP: Add some missing IEs 2022-11-02 16:56:12 +00:00
Emmanuel Grumbach 9339b357ea ieee80211: add a dissector for the protected EHT EML OP MODE notif
This an action frame to update the EMLSR / EMLMR mode.
This adds partial support for this frame.
It is fairly hairy to parse it because of its variable format, so for
now, just parse the EMLSR part and leave the EMLMR part for later.
2022-11-02 14:24:18 +00:00
Pau Espin 12a5c10664 gsm_osmux: Fix AMR_SID frame type payload size
According to TS 26.101, AMR_SID payload is 39 bits.
Hence, (39+7)/8 = 5, rounding to octet boundaries.

This fixes incorrect dissecting of Osmux frames containing AMR_SID
payloads.
2022-11-02 11:40:37 +01:00
Pascal Quantin a1c55f2356 GOOSE: add back goose.floating_point filter
Let's add it as a hidden filter for IEEE 754 single precision floating point

Closes #18491
2022-11-01 19:25:02 +00:00
David Perry 636c2d21ac Allow user-defined labels for Bluetooth UUIDs 2022-11-01 17:30:32 +00:00
John Thacker 80e287f82c Reset the "current conversation elements" after each dissector call
packet_info has items that correspond to the single "most recent"
conversation set via conversation_set_conv_addr_port_endpoints or
conversation_set_elements_by_id. These should be reset after each
call of a dissector, because they are only relevant for the
dissector and any additional higher level dissectors it calls.

Lower level protocols and protocols at the same level (i.e., in
different PDUs of a shared lower level protocol) don't want to
automatically use those conversation elements to find the current
conversation.

Separately, there should be an array or linked list of all conversation
elements set in a packet, so that it can be used by the conversation table,
conversation filters, etc., instead of just accessing the most recent
conversation / conversation based on the last set address and ports.

Fix #18278
2022-11-01 17:26:14 +00:00
Uli Heilmeier 5723e43293 BGP: Adding support for RFC8365
Fixes: #18393
2022-11-01 15:47:31 +00:00
David Perry f2105250fa Dissector CMakeLists: custom header+support files 2022-11-01 14:13:57 +00:00