Commit Graph

85952 Commits

Author SHA1 Message Date
David Perry 3d290f0248 Demonstrate `CUSTOM_TSHARK_TAP_SRC` for CMake 2022-12-07 18:50:28 +00:00
Moshe Kaplan f413260df9 WSLUA: Add new lua function register_packet_menu()
This adds support to Wireshark for custom context menus for packets, so
that when a packet's context menu is opened (e.g., by right-clicking),
Wireshark can support doing things like "run a program" or
"open a URL" with a field from the packet as a parameter. Note that
this is similar to ArcSight's integration commands feature.

For example, it could be used like the following:

```
ROBTEX_URL = "https://www.robtex.com/dns-lookup/"
local function search_robtex(...)
    local fields = {...};

    for i, field in ipairs( fields ) do
        if (field.name == 'http.host') then
            browser_open_url(ROBTEX_URL .. field.value)
            break
        end
    end
end
register_packet_menu("Search host in Robtex", search_robtex, "http.host");
```

Fixes issue #14998
2022-12-07 18:47:14 +00:00
Chuck Craft eff7cd15b0 github: repo_lockdown v2->v3 (node12->node16)
Last item on #18462. Will manually close after a good run on github.
2022-12-07 09:04:03 +00:00
Chuck Craft e490a3dd92 WSUG: (PDF) add fallback font for missing up/down arrows
https://github.com/asciidoctor/asciidoctor-pdf/issues/1811
Up/down arrow symbols not rendered to pdf #1811

asciidoctor-pdf bundled fonts don't include an Apple cmd symbol.
use "Cmd" as elsewhere in the WSDG.
2022-12-06 19:18:14 -06:00
Alexis Gryta 77a1cb0636 rpm packaging: Add .el7, .fc38, ... 2022-12-06 20:24:39 +00:00
Gerald Combs 932f4ff893 Qt: Don't use QString::toLocal8Bit().
As the QString::toLocal8Bit() documentation says,

"On Unix systems this is equivalen to toUtf8(), on Windows the systems
current code page is being used."

This is problematic for the Packet Comments dialog, since the comments
need to be UTF-8 as per the pcapng specification. Use toUtf8() instead
there and in the Import Text dialog.

Remove the toLocal8Bit() calls from the Extcap Options dialog since they
weren'nt needed.

Blind attempt at fixing #18698.
2022-12-06 17:19:07 +00:00
Tomasz Moń bad5ae8c42
USB: Allow registering protocol specific dissectors
Formerly only the class specific dissectors could be registered for
bulk, control and interrupt endpoints. While this is sufficient for
major classes, there are some classes that only use one or two of
possible class/subclass/protocol triple values. Allow registering
specific triples so appropriate dissector can be automatically selected
based on CONFIGURATION DESCRIPTOR data.

Register DFU Run-Time and DFU Mode triples so user no longer needs to
manually set Decode As for USB DFU.
2022-12-06 16:36:18 +01:00
John Thacker 74b1c07f91 test: Skip Follow HTTP2 test without Nghttp2
The expected test output is with the headers decompressed, which
we can't do without Nghttp2. (It outputs the compressed headers
if we don't have it, so we could test for that instead.)

Fix #18707
2022-12-06 07:21:58 -05:00
Tomasz Moń 2fcc819366
USBLL: Correctly handle last fragment retransmissions
Add fragment_add_check_with_fallback() and use it in USBLL dissector
instead of fragment_add_check() to avoid last fragment retransmissions
from being treated as separate transfers. With this change, the last
fragment retransmissions are correctly grouped together with the rest
of the transfer.

Only skip single fragment reassembly if retransmission is not possible
at the protocol level, i.e. for SETUP DATA0 (when it is not merged with
OUT data) and for isochronous transfers. The reassembly must not be
skipped for other transfers (especially for full-speed bulk) because
otherwise it wouldn't be possible to group retransmissions together with
the first data packet.

Do not use DATA0/DATA1 tracking for isochronous transfers. Isochronous
data cannot be retransmitted because there are no handshakes (there is
no ACK nor NAK after isochronous data packets).
2022-12-06 07:26:02 +01:00
Chuck Craft d153113cdf WSDG: retire Visual Studio 2019 for VS2022 2022-12-05 17:52:34 -06:00
Gerald Combs cb85a4b1a4 Qt: Convert our widgets and models to new-style signals & slots
Convert our remaining widget and model code to new-style signals and
slots.
2022-12-05 19:53:34 +00:00
Gerald Combs 0c1a10b02b Qt: Update an action name.
647978b8be renamed actionAnalyzeCreateAColumn to
actionAnalyzeApplyAsColumn. Update the packet list accordingly.
2022-12-05 10:03:18 -08:00
Stig Bjørlykke 6558b58e58 dtls: Support Connection ID when using Block Ciphers
Add support for DTLS Connection ID when using Block Ciphers
with the deprecated extention type (53) from
draft-ietf-tls-dtls-connection-id-07.

Closes #18705
2022-12-05 14:05:34 +00:00
João Valverde 237b7d02fe Update release notes 2022-12-05 13:41:33 +00:00
João Valverde b29ee628e2 IPv6: Remove some redundancies in address detail
The loopback and unspecified addresses are repeated. Keep
only the "special purpose" field, in accordance with the
IANA registry (and unlike RFC 4291) to remove the redundancy.

Add the "Unique Local Unicast" range to address space field,
also from the IANA registry.

Unique-Local and Link-Local are still repeated in both fields.
Oh well...
2022-12-05 13:39:38 +00:00
João Valverde d216f0a6e2 IPv6: Add special-purpose address detail
Add a field to show special purpose assignments listed in [1].

[1] https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
2022-12-05 13:39:14 +00:00
João Valverde f8d308e9af Kafka: Add more loop checks
Add a safeguard to limit the maximum number of iterations.

Do not allocate a new buffer for every loop iterations in a loop that
depends on the result of the decompression routine.

Either allocate the buffer once or free after use. Defensive programming
is more important than speed in this case.
2022-12-05 11:53:31 +00:00
João Valverde 60cb3dd3c6 CMake: Remove -Wjump-misses-init warning
If the jump misses init it's probably because the variable is
not used. Don't force contortions to avoid this common and
harmless case of "missing init" for an unused variable after
jumping.
2022-12-05 11:53:31 +00:00
João Valverde 2897e904f9 CMake: Remove redundant warning
-Wunused-const-variable is enabled with -Wunused-variable
which is enabled by -Wall.
2022-12-05 11:53:23 +00:00
Kevin Albertson 266a0d38b4 kafka: fix note of ZSTD_decompressStream return 2022-12-05 00:16:59 +00:00
Kevin Albertson 9412adf7bf kafka: stop decompressing once all input is consumed 2022-12-05 00:16:59 +00:00
John Thacker c36dde6e13 nxp_802154_sniffer: Add heuristics
UDP port 49999 is not IANA registered, so add some heuristics
to the NXP 802.15.4 sniffer so that it doesn't claim packets
from other protocols that have chosen that ephemeral port.

Don't return 0 after already adding things to the tree; do that
check in the heuristics.

Fix #18695
2022-12-04 23:51:10 +00:00
Gerald Combs 647978b8be Qt: Manually connect our "Analyze" menu actions. 2022-12-04 22:54:01 +00:00
Gerald Combs 3b7df80a0a [Automatic update for 2022-12-04]
Update manuf, services enterprise numbers, translations, and other items.
2022-12-04 16:48:16 +00:00
Martin Mathieson eba1f048b3 E2AP: Use S-NSSAI field in KPM 2022-12-04 13:38:12 +00:00
João Valverde f96885ab06 IPv6: Add multicast scope and flags address detail 2022-12-04 12:57:49 +00:00
Gerald Combs 5eb2a7f7b7 Qt: Miscellaneous ByteViewText fixes.
Don't use isEmpty() internally. Name a variable "em_width_" to match the
convention we use elsewhere. Use our viewport's font metrics.
2022-12-03 18:47:36 +00:00
Martin Mathieson b7c3bae518 check_typed_item_calls: add check for add_bitmask fields 2022-12-03 17:15:24 +00:00
John Thacker bd1f2cc996 epan: Use realloc when extending the uncompressed buffer
tvb_uncompress initially allocates an output buffer of twice the
input size. It is typical to have a compression ratio of 2:1 or
5:1, but in the extreme case (lots of all identical bytes), 1030:1
is possible.

When extending the output buffer, instead of always malloc'ing
a new buffer and memcpy'ing the old buffer into it, call realloc,
which at least some (most?) of the time will extend the current
buffer in place instead. This should reduce the time to unzip
from always O(N^2) (where N is the compression ratio) to something
average case more like O(N) or O(N log N), depending on how often
it actually copies the data. It only really affects pathological
cases.

Related to #13779.
2022-12-03 13:00:28 +00:00
João Valverde 868313956f proto: Tweak admonition for proto_tree_add_string()
Try the clarify the distinction and implications of a string
value vs a string label.
2022-12-03 11:28:48 +00:00
João Valverde 32f88ad22c wmem: Remove strbuf max size parameter
This parameter was introduced as a safeguard for bugs
that generate an unbounded string but its utility for
that purpose is doubtful and the way it is being used
creates problems with invalid truncation of UTF-8
strings.

Rename wmem_strbuf_sized_new() with a better name.
2022-12-03 01:54:52 +00:00
Harald Welte 3311b34106 gsmtap: Support V5-in-GSMTAP
GSMTAP has had support for various other ISDN related protocols as
sub-types of the GSMTAP_TYPE_E1T1 type.  We've recently started to work
on V5 (ITU-T G.964/G.965) and introduced a new sub-type for this.

Let's add the related dispatch from packet-gsmtap.c to packet-v5ef.c
2022-12-02 16:49:20 +01:00
Peter Dobransky 8683c4e328 Add support for missing DPoE and IEEE 1904.1 OAM attributes
DPoE
- D-ONU Packet Buffer (0xD7000A)

IEEE 1904.1
- aReadWriteMACAddress (0x07/0x00-1D)
- aPhyType (0x07/0x00-20)
- aAutoNegotiationAdminState (0X07/0x00-4F)
- aMACControlFunctionsSupported (0x07/0x00-5D)
- acConfigMulticastLlid (0xD9/0x01-07)
2022-12-02 08:35:02 +00:00
John Thacker 13823bb105 openflow_v6: Prevent infinite loops in too short ofp_stats
The ofp_stats struct length field includes the fixed 4 bytes.
If the length is smaller than that, report the length error
and break out. In particular, a value of zero can cause
infinite loops if this isn't done.
2022-12-01 21:18:12 -05:00
John Thacker 0e11932183 kafka: Don't try to decompress if the length is zero.
There's no point in trying to decompress a message with
length zero, and some of the third party decompression
libraries (e.g. zstd) can give unexpected results that
lead to infinite loops if we do so. A message length zero
is almost surely a file with errors.
2022-12-01 20:43:39 -05:00
João Valverde 967a3c3df9 Qt: Check field autocomplete for syntactical validity
Currently the autocompletion engine always suggests a protocol
field completion, even in places where it isn't syntactically
valid.

Fix that by compiling the preamble to the token under the cursor
and checking the returned error. If it is DF_ERROR_UNEXPECTED_END
that indicates a field or literal value was expected. Otherwise
a field replacement is not valid in this position.

Fixes #12811.
2022-12-01 22:50:09 +00:00
Tomasz Moń 5853886d50
reassembly: Store pointer to first gap
Store pointer to first gap to reduce number of full list traversals
needed when linking new fragments. When all captured fragments are in
order, the first gap is effectively pointing to list tail. The best case
scenario, where the list traversals are completely eliminated, happens
every time for protocols that always have the fragments ordered (most
notably USBLL Full-Speed capture containing Bulk OUT transfers with
a lot of retransmissions).

The memory usage is increased by a single pointer and 32-bit contiguous
length counter per fragment head. The additional CPU usage is constant
per insertion, i.e. does not increase with the number of fragments in
the list.

Fixes #17311
2022-12-01 20:14:40 +01:00
John Thacker 8623cd9746 icmpv6: Format DNS name as UTF-8 for output
DNS names technically have arbitrary unknown encoding.
When adding them as a string for output, format as UTF-8.

Fix #18689
2022-12-01 08:23:51 -05:00
John Thacker f2a0d25dba bpv6: Prevent infinite loops
display_extension_block is supposed to return the current offset,
not the number of bytes remaining, which can be less than the current
offset and cause an infinite loop. In the case of errors, set
lastheader and return the current offset to break out of loops.
2022-12-01 01:40:17 +00:00
Bernhard Dick 415296436b DECT-MITEL-ETH: Fix #18683
Adds missing NULL-termination in headerfield list in
dissect_dect_mitel_eth_mac_con_ind and removes handover to general data
dissector as this is path is no longer reached due to handling the
different message types within this dissector.
2022-11-30 23:53:34 +01:00
João Valverde b116ccd6d5 dfilter: Replace compile booleans arguments with a bit flag 2022-11-30 17:36:17 +00:00
João Valverde 84e75be5c6 dfilter: Add optimization flag
When we are just testing code to see if it compiles performing
optimizations is wasteful. Add an option to disable them.
2022-11-30 17:36:17 +00:00
Joakim Karlsson 4b0bf62791 asn2wrs: disable template line directive by default
Same as with !8955, To debug with line directive build with
-DENABLE_DEBUG_A2W=ON flag
2022-11-30 17:31:46 +00:00
João Valverde 729ea56b46 wmem: Remove wmem_strbuf_new_label()
Only dissectors are using this function and there is no use case,
as far as I know, that requires its use. Any limitation of length
is imposed transparently by the UI backend.

This function is problematic because it is not Unicode aware and
will truncate a string on an arbitrary byte boundary for multibyte
strings.

Replace its use with a normal strbuf without a length limite and
remove the function because it is not useful and the ITEM_LABEL_LENGTH
parameter does not belong in wmem anyway.
2022-11-30 15:55:54 +00:00
João Valverde 93814ef740 dfilter: Always set error pointer in case of failure 2022-11-30 15:00:34 +00:00
John Thacker 8a67ca77e6 http: Check CitrixAGBasic Auth encoding
CitrixAGBasic Authentication has Base64 encoded values. The result of
Base64 decoding is not guaranteed to be valid UTF-8 (or ASCII), so
verify it.

Also add the username and password to the credentials tap.

Fix #18677.
2022-11-30 07:54:01 -05:00
John Thacker 10c84b6450 HTTP2: Load dynamic hf entries when UAT is changed
The dynamic hf entries for HTTP2 read from the UAT should be
changed when the UAT is changed or reset, not on each file
load and file close. If a field is added as a column, coloring
rule, or filter, and the capture file is changed, deregistering
the field and reregistering it can cause a crash.

Use the same approach as with HTTP and SIP, slightly modified
because in HTTP2 the header fields hash contains the static
headers as well, to prevent adding duplicate entries via the UAT.

Fix #14768
2022-11-30 11:04:05 +00:00
Joakim Karlsson 5b8cb733fa asn2wrs: disable line directive by default
To debug with line directive build with -DENABLE_DEBUG_A2W=ON flag
2022-11-30 11:03:09 +00:00
Martin Mathieson 6eb734995a Change the re for matching an item's label 2022-11-30 09:25:13 +00:00
Martin Mathieson c69d0114ea tools/check_static.py - fix remaining errors 2022-11-30 08:49:38 +00:00