Commit Graph

85691 Commits

Author SHA1 Message Date
John Thacker dcbd3874d3 tls: add support for DESEGMENT_UNTIL_FIN, sequence numbers
Add a tlsinfo struct that is similar to tcpinfo, and carries
the sequence number (within the TLS stream) and the end of
stream notification (from the TCP FIN or close_notify alerts)
in addition to the session app handle pointer already used
by TLS heuristic dissectors.

Have HTTP use the end of stream notification in order to
handle DESEGMENT_UNTIL_FIN the same way it does when HTTP
is directly over TCP. Also have HTTP use the sequence number
in order to reduce chunked processing from O(N^2) to O(N)
similar to done over TCP.

Update all the TLS heuristic dissectors that set the app
handle to use the new structure.

Note the workaround for the issue #15159 - the TLS dissector
has to report to the TCP dissector that desegmentation at FIN
is required, so that the TCP dissector will know to call the
TLS dissector at FIN. However, the TLS dissector does not request
that the TCP dissector resend bytes belonging to records that
TLS has already desegmented (and decrypted, if possible), to
avoid decrypting twice (and upsetting the decoder state.)

This can mean the TCP dissector calling the TLS dissector to
desegment at FIN with a zero byte payload. In such as case, the
TLS dissector artificially returns "1" byte dissected to avoid
indicating rejecting the payload and having the TLS (and subdissector)
layers removed. (TCP ignores the value returned when desegmenting
at FIN.)

Fix #9154. Fix #14382.
2022-11-01 10:03:35 +00:00
Eugène Adell 6759377b93 TCP: Overriding of the automatic SEQ Analysis 2022-11-01 10:01:35 +00:00
John Thacker 891716800b http: Store request/response data there, not in the conversation
The host, request method, request URI, and response code are
information that are local to a request/response pair. Storing
them in the conversation data struct means that we only have access
to one set of values at any one point.

Currently they are updated every time a packet is dissected,
which is fine for sequential processing but causes unexpected
behavior when scrolling the window upwards, going directly
to a packet, or filtering, among other out of order behavior.

Store the values in the per packet data, and create the
file scoped data only on the first pass. The conversation
level data will have access to the final http_req_res_t
struct, which is useful for connections that Upgrade to a
different dissector.

Also, when a response code is in the Informational 1xx category,
that means it is an interim response and the next response could
be for the same request. (This affects 100 Continue, 103 Early
Hints, etc.)

Fix #16753.
2022-11-01 09:56:41 +00:00
John Thacker 1293f15897 AMQP: Add field table values as fields
Add the name, type, and values of field tables and arrays as
fields under the FT_NONE header. This makes them filterable
and show up in JSON export.

Fix #18385
2022-11-01 09:54:03 +00:00
HOMEPC\eaosk cabe0e0239 Filling in information about the server in the tap listener 2022-11-01 09:15:30 +00:00
Nan Xiao 212c90f6d5 QUIC: fix typo 2022-11-01 15:01:43 +08:00
Alexis La Goutte 2f75f65b7f ieee80211: remove duplicate entry
packet-ieee80211.c:33184 hf_ieee80211_addr_ta called consecutively at line 33184 - previous at 33183
2022-10-31 23:20:42 +00:00
Alexis La Goutte a9d32c9316 ieee80211: fix item type is FT_UINTY but call has len X
packet-ieee80211.c:10060 proto_tree_add_item called for hf_ieee80211_hs20_icons_avail_len  -  item type is FT_UINT8 but call has len 2
packet-ieee80211.c:11869 proto_tree_add_item called for hf_ieee80211_ff_key_data_length  -  item type is FT_UINT8 but call has len 2
packet-ieee80211.c:21328 proto_tree_add_item called for hf_ieee80211_s1g_short_beacon_interval  -  item type is FT_UINT8 but call has len 2
packet-ieee80211.c:32379 proto_tree_add_item called for hf_ieee80211_pentapartial_timestamp  -  item type is FT_UINT8 but call has len 5
packet-ieee80211.c:32932 proto_tree_add_item called for hf_ieee80211_pv1_cnt_bat_bitmap  -  item type is FT_UINT16 but call has len 4
2022-10-31 23:20:42 +00:00
Alexis La Goutte a06288d78c ieee80211: fix mask has odd number of digits
packet-ieee80211.c filter= wlan.he_ndp.sta_info.ru_start  - mask has odd number of digits 0x3F800 expected max for FT_UINT32 is 8
packet-ieee80211.c filter= wlan.he_ndp.sta_info.ru_end  - mask has odd number of digits 0x1FC0000 expected max for FT_UINT32 is 8
2022-10-31 23:20:42 +00:00
Alexis La Goutte e0c4172681 ieee80211: fix filter "wlan.fixed.publicact" appears consecutively
/packet-ieee80211.c: - filter "wlan.fixed.publicact" appears consecutively - labels are "Public Action"" and "Protected Public Action""
2022-10-31 23:20:42 +00:00
Martin Mathieson 2e98ceb0d1 E2AP: Following ans2wrs.py fix, can now extend RANParameter-ID range 2022-10-31 23:01:23 +00:00
João Valverde 4c2d0f16d4 dfilter: Improve representation of raw field references
Instead of using the abstract type "<RAW>", which might be confusing,
show FT_BYTES, but display the representation with the "@" operator,
so it's not even more confusing in error messages why a field might
flip-flop types.

Refactor the field tostr() function and some other clean ups.

Before:
```
Filter: _ws.ftypes.string ==${@frame.len}
dftest: _ws.ftypes.string and frame.len <RAW> are not of compatible types.
	_ws.ftypes.string ==${@frame.len}
	                       ^~~~~~~~~
```

After:
```
Filter: _ws.ftypes.string ==${@frame.len}
dftest: _ws.ftypes.string <FT_STRING> and @frame.len <FT_BYTES> are not of compatible types.
	_ws.ftypes.string ==${@frame.len}
	                       ^~~~~~~~~
```
2022-10-31 21:02:39 +00:00
João Valverde b83658d8a4 dfilter: Add suport for raw addressing with references
Extends raw adressing syntax to wok with references. The syntax
is
    @field1 == ${@field2}

This requires replicating the logic to load field references, but
using raw values instead. We use separate hash tables for that,
namely "references" vs "raw_references".
2022-10-31 21:02:39 +00:00
João Valverde 0853ddd1cb dfilter: Add support for raw (bytes) addressing mode
This adds new syntax to read a field from the tree as bytes, instead
of the actual type. This is a useful extension for example to match
matformed strings that contain unicode replacement characters. In
this case it is not possible to match the raw value of the malformed
string field. This extension fills this need and is generic enough
that it should be useful in many other situations.

The syntax used is to prefix the field name with "@". The following
artificial example tests if the HTTP user agent contains a particular
invalid UTF-8 sequence:

    @http.user_agent == "Mozill\xAA"

Where simply using "http.user_agent" won't work because the invalid byte
sequence will have been replaced with U+FFFD.

Considering the following programs:

    $ dftest '_ws.ftypes.string == "ABC"'
    Filter: _ws.ftypes.string == "ABC"

    Syntax tree:
     0 TEST_ANY_EQ:
       1 FIELD(_ws.ftypes.string <FT_STRING>)
       1 FVALUE("ABC" <FT_STRING>)

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

    $ dftest '@_ws.ftypes.string == "ABC"'
    Filter: @_ws.ftypes.string == "ABC"

    Syntax tree:
     0 TEST_ANY_EQ:
       1 FIELD(_ws.ftypes.string <RAW>)
       1 FVALUE(41:42:43 <FT_BYTES>)

    Instructions:
    00000 READ_TREE		@_ws.ftypes.string <FT_BYTES> -> reg#0
    00001 IF_FALSE_GOTO	3
    00002 ANY_EQ		reg#0 == 41:42:43 <FT_BYTES>
    00003 RETURN

In the second case the field has a "raw" type, that equates directly to
FT_BYTES, and the field value is read from the protocol raw data.
2022-10-31 21:02:39 +00:00
João Valverde 31a0147daa dfilter: Pass a value by reference
The lifetime of the reference is longer than the runtime so avoid
an unecessary fvalue dup.
2022-10-31 21:02:39 +00:00
João Valverde 0583b76204 dfilter: Remove unused data structure 2022-10-31 21:02:39 +00:00
Roland Knall 5f46ce935e Profiles: Fix export crashing for single profile
When the classic profile has been cloned, and it contains
coloring rules, that are no longer valid or their syntax is
wrong, the export of single profiles will fail.

The reason for that is still being investigated. It seems
there might be an issue with selecting the right coloringfilter
to be selected.

This change only fixes the coloringrules file and the
index is selected from the base model instead
2022-10-31 18:53:50 +00:00
Huang Hao 58390334eb asn2wrs.py: fix Needs64b 2022-10-31 18:33:51 +00:00
Roland Knall 759e571c05 dbus: Use proper conversation function name 2022-10-31 17:52:59 +00:00
Nils Hanke 34a66401e8 UI: Only sort visible packets instead of all packets
Previously, Wireshark was sorting all packets in a capture,
regardless whether they were actually visible or not. If you
are working with large PCAPs & filters, this is a MASSIVE
performance drag. Therefore, this commit changes this
by only sorting the visible packets which boosts the
sorting performance in filtered views massively.
2022-10-31 16:50:11 +00:00
John Thacker fe4b063954 IPP: Add the charstring value so it is filterable
For a string, add the value from the packet normally so that the
value is filterable, shows up in JSON, etc. Prepend the tag
description to the item so the formatting is displayed in the
tree with the name like it has been.
2022-10-31 16:06:27 +00:00
Alexis La Goutte 8d17d1fe7a ftp: fix Dead Store found by Clang Analyzer
line 949, column 5 Value stored to 'offset' is never read
2022-10-31 16:05:12 +00:00
John Thacker 2ad4b5bb3c Qt: Generate filter expressions for columns with multiple occurrences
Generate filter expressions for columns with multiple occurrences
by using the membership operator (which is semantically OR).
It's not clear if this approach makes more sense than AND;
there's use cases for both.

Don't do this for multifield custom columns, since we don't know
which values were found by which field. That takes changing
the column logic in several places.

Ping #18001
2022-10-31 16:03:24 +00:00
j.novak@netsystem.cz 3aafecb7b9 Main dialog: Wireshark stops extcap on exit if no packets received yet 2022-10-31 16:01:58 +00:00
Dylan Ulis 190b74bc06 PTP: Enable analysis by default 2022-10-31 15:18:21 +00:00
Simon Holesch d5d635d7b7 D-Bus: Resolve unique names into well-known names
Use the information gained from conversation tracking to infer
well-known names. Show well-known names as addresses to improve the
readability of a D-Bus capture.
2022-10-31 14:54:39 +00:00
Simon Holesch 034ac6dad9 D-Bus: Add member to response frame in info column
Add the method name to response frames, like Method Return and Error.
The name is not included in the frame itself, but can be inferred with
conversation tracking.
2022-10-31 14:54:39 +00:00
Simon Holesch 60aec65e9f D-Bus: Add path, interface, member to responses
Add generated fields with the value from the request. D-Bus response
frames don't include fields like "member", i.e. the method name. By
adding generated fields it's easier to filter method calls and its
method return by name.
2022-10-31 14:54:39 +00:00
Simon Holesch 8f6a640337 epan: Allow FT_UINT_STRING for proto_tree_add_string()
Since cbd3c447 ("ftypes: Add FT_UINT_STRING to IS_FT_STRING() macro")
proto_tree_add_string() accepts FT_UINT_STRING, but the API check still
fails. Update the API check to reflect that change.
2022-10-31 14:54:39 +00:00
Simon Holesch 76301761bb D-Bus: Add conversation tracking 2022-10-31 14:54:39 +00:00
Eugène Adell e207d65830 TCP: Obvious Retransmission RTO is wrong 2022-10-31 14:49:00 +00:00
Chuck Craft 8de2b2e860 addr_resolv: add support for static hostname entries
Ping #18075
2022-10-31 14:45:56 +00:00
Eugène Adell 2578e2a1fb TCP: last packet of a disordered series is marked as Retransmission 2022-10-31 14:42:14 +00:00
Miroslav Lichvar d892d28481 NTP: Improve handling of poll and precision fields
The poll and precision fields in timing NTP messages are signed
integers.

Different NTP implementations have different minimum and maximum polling
intervals. Some can be configured even with negative values for
sub-second intervals (e.g. down to -7 for 1/128th of a second).

NTP clocks on modern systems and hardware typically have
a sub-microsecond precision.

Print all poll values. Add the raw precision and change the resolution
of the printed value to nanoseconds.
2022-10-31 14:38:50 +00:00
John Thacker b025c45cf3 TLS: Don't assert on zero length handshake fragment
The fragment functions will work with a zero length fragment,
which might happen if a record length is zero in a malformed
packet and a reassembly is in progress. It is not by itself
a fatal error (and could actually work, even though
non-compliant.) There is already a tls.record.length.invalid
expert info added by ssl_check_record_length for this case.

Related to #17890.
2022-10-31 14:36:55 +00:00
Jaap Keuter 69daf2e339 QT: When opening files, filter on All Capture Files immediately 2022-10-31 14:35:49 +00:00
Huang Qiangxiong 89452ef2fc Protobuf: Fix a google.protobuf.Timestamp displaying bug
1. Fix the bug that the timestamp of google.protobuf.Timestamp message
   type does not displayed while pbf_as_hf (Dissect Protobuf fields as
   Wireshark fields) is FALSE.

2. Add the use_utc preference for displaying google.protobuf.Timestamp
  in UTC or local zone format.
2022-10-31 14:24:42 +00:00
Jim Young 11990f258d Qt: Add ProgressFrame to the Expert Information dialog 2022-10-31 14:15:18 +00:00
Chuck Craft 81bd7b1415 Qt: filter_dialog - make Cancel button functional
Works properly when called from Capture/Display filter bookmark.
This change duplicates that code.
2022-10-31 14:14:00 +00:00
j.novak@netsystem.cz dd5f86c674 Capture options dialog: Fix start of capture by double click 2022-10-31 14:07:49 +00:00
Maurice Lam 460d4c85c2 Allow custom dissectors for BLE advertisement service UUIDs
Add a dissector table "btcommon.eir_ad.entry.uuid_16", which behaves the same
way as the hard-coded GAEN (Google/Apple Exposure Notification) dissector does
today -- the table key is the 16-bit UUID
(https://www.bluetooth.com/specifications/assigned-numbers/), and the dissector
is given the corresponding service data.
2022-10-31 13:21:58 +00:00
Adrian Granados 420ec1511d extcap: fix missing control frames from wifidump capture
Normally, 'control' and 'otherbss' flags are set when
using monitor mode, but certain Wi-Fi drivers (e.g. MT7921)
need to explicitly have these flags set in order to capture
control frames.
2022-10-31 13:20:06 +00:00
Michael Metzinger 3da9603b9e AMQP: call sub dissector via UAT 2022-10-31 13:18:31 +00:00
David Perry c8a4b8d611 packet-json: move away from `wmem_packet_scope()` 2022-10-31 13:14:40 +00:00
Rubin Gerritsen 887fc09100 Bluetooth: Fix detection of colliding peer proc
A device is not allowed to start a new control procedure if it
has already responded to a peer procedure.

The detection of a response being present did not take into account
that some procedures do not have a response.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-10-31 13:10:53 +00:00
ismaelrti 96de1ce181 RTPS: Clang warnings cleaned in RTPS protocol
- Binary integer literals are a GNU extension warning cleaned
- core.NullDereference cleaned
2022-10-31 13:09:20 +00:00
Alexis La Goutte 71a21ca1ca thrift: fix conflict 2022-10-31 13:07:58 +00:00
Chuck Craft 00179b710c NSIS: add Extcap group; tidy up other groups and WSUG
Partial fix for https://ask.wireshark.org/question/29063/
Event Tracing for Windows ETW file reader
Future work: add user friendly Extcap examples to WSUG and wiki
2022-10-31 12:14:34 +00:00
Vadim Yanitskiy 9de9a7900f GSM A RR: de_rr_meas_res(): also show padding as a tree item 2022-10-31 12:12:24 +00:00
Vadim Yanitskiy 3829e598a5 GSM A RR: fix de_rr_meas_res(): properly return consumed length
According to 3GPP TS 44.018 section 10.5.2.20, the Measurement Results
is a type 3 (TV) information element with 17 (1 + 16) octets length.

The respective dissection function is called as follows:

  ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_MEAS_RES, ...)
    elem_v(tvb, tree, pinfo, GSM_A_PDU_TYPE_RR, DE_RR_MEAS_RES, ...)
      de_rr_meas_res(tvb, subtree, pinfo, curr_offset, -1, ...)
                                                      ^^^
                                                      len

Note that elem_v() passes -1 as the len argument to de_rr_meas_res().
The later returns -1 casted to guint, and this is indeed wrong.
Moreover, the 'len' argument is marked as unused (_U_).

This bug creates a false impression that the Measurement Results IE
occupies more octets than it actually does when it's encapsulated
into some other protocol, e.g. A-bis/RSL.

Let's return value 16, which is known from the specs.
2022-10-31 12:12:24 +00:00