Commit Graph

85157 Commits

Author SHA1 Message Date
Guy Harris e5951765d8 Dissector names are not protocol names.
A given protocol's packet format may depend, for example, on which
lower-level protocol is transporting the protocol in question.  For
example, protocols that run atop both byte-stream protocols such as TCP
and TLS, and packet-oriented protocols such as UDP or DTLS, might begin
the packet with a length when running atop a byte-stream protocol, to
indicate where this packet ends and the next packet begins in the byte
stream, but not do so when running atop a packet-oriented protocol.

Dissectors can handle this in various ways:

For example, the dissector could attempt to determine the protocol over
which the packet was transported.

Unfortunately, many of those mechanisms do so by fetching data from the
packet_info structure, and many items in that structure act as global
variables, so that, for example, if there are two two PDUs for protocol
A inside a TCP segment, and the first protocol for PDU A contains a PDU
for protocol B, and protocol B's dissector, or a dissector it calls,
modifies the information in the packet_info structure so that it no
longer indicates that the parent protocol is TCP, the second PDU for
protocol A might not be correctly dissected.

Another such mechanism is to query the previous element in the layers
structure of the packet_info structure, which is a list of protocol IDs.

Unfortunately, that is not a list of earlier protocols in the protocol
stack, it's a list of earlier protocols in the dissection, which means
that, in the above example, when the second PDU for protocol A is
dissected, the list is {...,TCP,A,B,...,A}, which means that the
previous element in the list is not TCP, so, again, the second PDU for
protocol A will not be correctly dissected.

An alternative is to have multiple dissectors for the same protocol,
with the part of the protocol that's independent of the protocol
transporting the PDU being dissected by common code.  Protocol B might
have an "over a byte-stream transport" dissector and an "over a packet
transport" dissector, with the first dissector being registered for use
over TCP and TLS and the other dissector being registered for use over
packet protocols.  This mechanism, unlike the other mechanisms, is not
dependent on information in the packet_info structure that might be
affected by dissectors other than the one for the protocol that
transports protocol B.

Furthermore, in a LINKTYPE_WIRESHARK_UPPER_PDU pcap or pcapng packet for
protocol B, there might not be any information to indicate the protocol
that transports protocol B, so there would have to be separate
dissectors for protocol B, with separate names, so that a tag giving the
protocol name would differ for B-over-byte-stream and B-over-packets.

So:

We rename EXP_PDU_TAG_PROTO_NAME and EXP_PDU_TAG_HEUR_PROTO_NAME to
EXP_PDU_TAG_DISSECTOR_NAME and EXP_PDU_TAG_HEUR_DISSECTOR_NAME, to
emphasize that they are *not* protocol names, they are dissector names
(which has always been the case - if there's a protocol with that name,
but no dissector with that name, Wireshark will not be able to handle
the packet, as it will try to look up a dissector given that name and
fail).

We fix that exported PDU dissector to refer to those tags as dissector
names, not protocol names.

We update documentation to refer to them as DISSECTOR_NAME tags, not
PROTO_NAME tags.  (If there is any documentation for this outside the
Wireshark source, it should be updated as well.)

We add comments for calls to dissector_handle_get_dissector_name() where
the dissector name is shown to the user, to indicate that it might be
that the protocol name should be used.

We update the TLS and DTLS dissectors to show the encapsulated protocol
as the string returned by dissector_handle_get_long_name(); as the
default is "Application Data", it appeaers that a descriptive name,
rather than a short API name, should be used.  (We continue to use the
dissector name in debugging messages, to indicate which dissector was
called.)
2022-09-10 22:37:11 -07:00
Gerald Combs 8f34e3df98 Add Logray capture icons. 2022-09-10 23:35:27 +00:00
Gerald Combs 1a9842b423 Qt: Fix a variable name.
Don't use a trailing underscore for a local variable name.
2022-09-10 15:39:35 -07:00
Tomasz Moń 1a148b1133 Qt: Fix crash on copy as actions in protocols pane
Allocate FieldInformation on heap instead of stack so it is available
when copy action is triggered.

Fixes #18282
2022-09-10 22:35:55 +00:00
Tomasz Moń 6346cf945a Qt: Connect menu actions with Qt::QueuedConnection
Prevent crash due to premature menu object deletion caused by call to
QCoreApplication::processEvents() by executing the slot only after menu
handling has finished.

Fixes #18251 and #18270
2022-09-10 22:34:48 +00:00
Martin Mathieson e58761988b ROHC: more comments 2022-09-10 18:29:46 +00:00
Alexis La Goutte 232386e551 ISAKMP: Add some Fortinet (VID)
* Auto-Discovery Receiver (Fortinet)
* Exchange Interface IP (Fortinet)
2022-09-10 16:39:01 +00:00
Jaap Keuter 3af3ebccd7 Tools: source CT log list in V3 schema 2022-09-10 16:34:10 +00:00
Guy Harris 38f83c7f19 oscore: minor cleanups.
The data argument to oscore_dissect(), so don't mark it as unused.

As long as we're declaring a proto_reg_handoff_oscore(), we should
define one; it can serve as a container if we ever have any phase-2
(handoff phase) registration work to do.
2022-09-10 01:45:28 -07:00
Chuck Craft 8064d9a721 dumpcap: typo in pcap_geterr() string comparison
Ping #18332
2022-09-09 22:46:32 -05:00
Gerald Combs 9206c4b8fa Tools: Switch the BSD setup script to Qt6.
Switch bsd-setup.sh to Qt6.
2022-09-09 17:56:30 -07:00
Martin Mathieson 90ff7c63c7 ROHC: clean up header file and add some comments. 2022-09-09 08:09:26 +00:00
John Thacker af0b20a969 http-urlencoded: Pass the correct string length to get_utf_8_string
Pass in the correct length of the percent decoded string, which
is not necessarily the same as the value calculated from the offsets.
Fix #18322. Fix #18325.
2022-09-08 23:12:58 -04:00
John Thacker 2c37027762 Qt: Fix resolved addresses dialog sorting, filtering, Ethernet groups
Qt6 removed QComboBox:currentIndexChanged(QString), which had
previously been deprecated in favor of the version with an int.
Switch to using the supported function, so that the comboboxes
work.

The models used for the resolved addresses require that the
source models be set first before setting other properties,
so do that so that filtering works.

For some reason the portTypeModel has to indicate that the
port number column is numeric in order for the ports to
numerically sort instead of lexicographically, so do that too.

Add the Ethernet addresses in their specific groups (Addresses,
Manufacturers, Well-Known Hosts) instead of adding them all
to the Well-Known hosts groups, so that that filtering works.

Fix #18087
2022-09-09 01:03:36 +00:00
ismaelrti 5dd8e858a9 RTPS: Added new discovery participant submessages
Added support for Participant bootstrap, secure and config submessages.
2022-09-08 19:10:28 +00:00
Gerald Combs 3739f3d041 BACapp: Fix a buffer length check.
Make sure we don't overwrite a string's NULL terminator.
Fixes #18324.
2022-09-08 18:54:10 +00:00
Gerald Combs 74ec0f0816 Qt+extcap: Make our capture error dialog less noisy.
Strip the timestamps and function names from extcap errors before
displaying them in a dialog. This keeps us from spewing

```
Error by extcap pipe: ** (falcodump:24913) 15:08:20.263535 [falcodump
WARNING] extcap/falcodump.cpp:593 -- main(): cloudtrail plugin error:
failed to list objects: ExpiredToken: The provided token has expired.
status code: 400, request id: M2PYJOT4JGVAA6B9, host id:
+4V8Q+DGV+80Jd3fdc7tODyVdTRvepNgCD9zuvXeL7kzvp2oikaoi9CLMW+UKt/
aR1G2UXIqyQ8=
```

at the user.

Check for warning messages and set our dialog type accordingly.
2022-09-08 10:20:48 -07:00
Dr. Lars Völker 503c11034f UDS: Fix Typo SecuredDataTransmission 2022-09-08 12:00:55 +00:00
John Thacker 33fe76612a Qt: Don't use obsolete signal in DCE-RPC/ONC-RPC SRT
QComboBox::currentIndexChanged(QString) has been marked
obsolete for a while and finally removed in Qt 6 in favor
of currentIndexChanged(int) and currentTextChanged(const QString)

Use QComboBox::currentTextChanged(const QString) instead.
Also do a little bit of checking to see if the return value
of dcerpc_get_proto_sub_dissector is NULL.

Fix #18319.
2022-09-08 03:55:43 +00:00
John Thacker e25f0508aa proto: Fix truncation of UTF-8 strings.
It is correct to pass in the memory address immediately past
the end of our buffer, as g_utf8_prev_char() does not deference
it until after decrementing it once, and we want to find the final
UTF-8 character start. Starting one byte earlier truncates the string
more than necessary.

This effectively reverts 4b6224a673
which noted that Coverity flagged this as a memory access error,
although it is not. This is possibly because it was written as
&label_str[ITEM_LABEL_LENGTH]. All versions of the ISO C standard
starting with C99 have indicated (6.5.3.2) than in such a case
"neither the & operator nor the unary * that is implied by the [] is
evaluated and the result is as if the & operator were removed and the
[] operator were changed to a + operator" and (6.5.6) that referring
to the memory address one past the last element of an array object
"shall not produce an overflow" and is not undefined (so long as it
not deferenced.)

However, Coverity may not have been aware of this, so rewrite
the expression using the + operator in the hopes of avoiding
false positive Coverity errors.
2022-09-08 00:56:07 +00:00
Gerald Combs 55ff784bf9 NSIS: Uninstall more files.
Uninstall networkinformation and tls DLLs added by Qt 6.
2022-09-07 15:14:45 -07:00
Gerald Combs b54219f7ad GitLab CI: Update our digest algorithms.
OpenSSL 3 deprecated RIPEMD160. Remove it from our list of digest
algorithms and add SHA512.
2022-09-07 10:37:35 -07:00
Uli Heilmeier b81948f534 Qt: Fix implicit conversion
Fix

ui/qt/widgets/syntax_line_edit.cpp:160:51: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
            .arg(QString('~').repeated(loc_length - 1));
                              ~~~~~~~~ ~~~~~~~~~~~^~~
ui/qt/widgets/syntax_line_edit.cpp:159:40: warning: implicit conversion loses integer precision: 'qsizetype' (aka 'long long') to 'int' [-Wshorten-64-to-32]
            .arg(QString(' ').repeated(loc_start))
                              ~~~~~~~~ ^~~~~~~~~

when building with Qt 5.
2022-09-07 15:17:00 +00:00
AndersBroman 0cbf8eae49 Update uat.h 2022-09-07 13:47:09 +00:00
Anders Broman 1ebb0e2aba UAT_BUFFER_CB_DEF: Try to fix signed/unsigned warnings 2022-09-07 15:25:36 +02:00
Anders Broman 625b422edf Try to fix clang tvb_memeql-warnings 2022-09-07 14:07:47 +02:00
Anders Broman 83a0ec0647 opcua: Squelch a couple of warnings by adding casts. 2022-09-07 08:19:39 +00:00
Anders Broman cda3a3dbe9 strutil.h: Fix function description. 2022-09-07 08:31:20 +02:00
John Thacker 2dfbed7a5f Qt: Connect ExportDissectionDialog to filesSelected
QFileDialog.accept() emits the filesSelected signal when the
dialog is accepted but before it calls QDialog.accept().
Connect our dialogAccepted function the filesSelected signal
instead of the accepted signal, so that all the exporting
happens sooner, before the ExportDissectionDialog gets
closed (and then deleted, since DeleteOnClose is set on the
dialog.)

This fixes use-after-free and segfaults in Qt 6.3 (which changed
things so that QDialog and widgets that inherit from it get closed
earlier.) Fix #18318
2022-09-07 00:54:42 +00:00
Gerald Combs 6a5a4cfcfb GitLab CI: APT package updates.
Don't pass "-Zgzip" to dpkg-buildpackage on Ubuntu. Newer versions
default to zstd. Pass "-zfast" to dpkg-buildpackage on Debian and use
ccache.
2022-09-06 15:29:34 -07:00
Jim Young 1e030a8f59 Qt: Avoid clipping the text label field in progressFrame 2022-09-06 17:05:38 +00:00
John Thacker 248ff020e7 urlencoded: Decode charset before adding the string
After percent decoding a key or value in x-www-form-urlencoded,
decode the string as UTF-8 (substituting REPLACEMENT CHARACTER
as needed) per https://url.spec.whatwg.org/#urlencoded-parsing

Passing an unvalidated string to proto_tree_add_string() results
in the string being treated as UTF-8, but odd things happen when
e.g. exporting packet dissections (See #18317). This prevents
production of invalid JSON and XML.

Only UTF-8 is conforming according to WHATWG, though ideally
a charset parameter in the media string should be respected,
and there should be expert infos if the string did not decode
as UTF-8 cleanly.
2022-09-06 11:48:03 +00:00
Martin Mayer 771022261f Art-Net: Upgrade dissector to Rev. 1.4 DE 2022-09-06 11:11:30 +00:00
Martin Mathieson 6d46a532a2 Fix some spelling errors. 2022-09-06 10:15:11 +01:00
Dr. Lars Völker 0f648f152f ISO15765: Adding support to run over PDU Transport
This patch allows to bind ISO15765 to PDU Transport PDUs.
2022-09-06 07:02:17 +00:00
Denis Zhang d6fd9768a7 Add Perfectek vendor code 2022-09-06 02:20:42 +00:00
Dr. Lars Völker 2c2710e3e7 AUTOSAR-IPDUM: Remove warning by adding missing newline 2022-09-05 18:33:25 +00:00
Dr. Lars Völker 79e76e9c2f MacOS: Add qt6 to MacOS Brew Setup 2022-09-05 17:58:20 +00:00
Gerald Combs 4819716f14 Tools: Switch make-manuf.py URLs to HTTPS.
standards-oui.ieee.org is now served over HTTPS.
2022-09-05 17:55:33 +00:00
Jason Cohen 67326401a5 f5ethtrailer: Fix possible infinite loop in legacy trailer heuristic 2022-09-05 17:31:42 +00:00
Guy Harris eb83e055b8 AppleTalk, DSI: get rid of the "command" field.
It's not needed.

Instead, have get_transaction() return the request_val; the caller can
fetch the command from its "value" member.

While wee're at it, update some of the web reference information for
DSI.
2022-09-04 18:13:06 -07:00
Gerald Combs ab4a4304ee Add Logray icons.
Add lricon.svg and lriconinst.svg, which provide the core graphic
element for the various Logray icons. Add lricon*.png, which were
created using the templates at
https://developer.apple.com/design/resources/. Add Logray.icns,
logray.ico, and lograyinst.ico, and use them in various packaging
resources.
2022-09-04 23:01:06 +00:00
Michael Tuexen 9315cffd6a SCTP: remove support for NONCE_SUPPORTED parameter
The specification never hit RFC status, it wasn't implemented or
deployed and the ECN nonce stuff was moved to HISTORIC recently..
So remove support from the dissector, freeing parameter type
0x8001, which was also never assigned by IANA.
2022-09-04 22:06:03 +02:00
Gerald Combs 56a101f4d4 [Automatic update for 2022-09-04]
Update manuf, services enterprise numbers, translations, and other items.
2022-09-04 16:43:03 +00:00
Guy Harris a960e5fd2e AppleTalk, DSI: fix some names to be more correct.
The "seq" field in several structures is either a transaction ID from
ATP for AppleTalk or a request ID from DSI for AFP-over-TCP.  Call it
tid.

The "aspinfo" structure is really information from ATP *and* ASP for
AppleTalk or from DSI for AFP-over-TCP.  Call it atp_asp_dsi_info.

Among other things, this prevents confusing "aspinfo.seq" from the ASP
sequence number, which it is *NOT*.
2022-09-04 01:21:06 -07:00
Guy Harris 09785f0729 frame: always add the "length < caplen" expert info.
Add the "length < caplen" expert info regardless of whether the "frame"
protocol is referenced by a packet-matching expression, just as we do
with the "fractional time component of the absolute frame time is >=
1000000000" expert info.

Fixes #18312.
2022-09-03 23:10:36 -07:00
Guy Harris 022dfd56f3 Fix bogus tvbuffs to make sure reported length >= captured length.
A reported length less than a captured length is bogus, as you cannot
capture more data than there is in a packet.

Fixes #18313.
2022-09-03 21:04:55 +00:00
John Thacker e76ebbdecc epan: Fix tvb_find_guint16 with previous partial matches
Fix tvb_find_guint16 when there is a partial match (first byte
matches but second byte does not) in the buffer before an
actual match.

The function claims that it takes negative offsets and a negative
maxlength value (for "to the end of the buffer.") Convert those to
absolute offsets and limits at the start of the function rather than
repeatedly having special checks for negatives.

Fix the "number of bytes searched so far" calculation, which was only
correct for negative offsets (but only used when there was a partial
match.)
2022-09-03 20:05:41 +00:00
John Thacker 95b45b2555 Qt: Add percent-encoding to Show Packet Bytes
Add Percent-encoding to the list of encoding types that Show
Packet Bytes can handle.

There's a function added to glib 2.66 to handle this for arbitrary
bytes that might have internal nulls (and which allows the result
to be non UTF-8), but we don't require that version yet, so extend
the existing function.

Related to #1084
2022-09-03 17:25:28 +00:00
Martin Mathieson faf05a82da ROHC: trivial comments and changes while reading code. 2022-09-03 15:38:14 +01:00