Commit Graph

88435 Commits

Author SHA1 Message Date
John Thacker 00216e7e0b epan: Decrease dependent frame hash table size
The table of dependent frames is really a set, not a hash table,
as we never use the value, only the keys / frame numbers. If you
only ever store the key itself as the value, glib optimizes by not
allocating space for the values. This optimization does not occur
if e.g., NULL is always used as the value.

Use the convenience function g_hash_table_add to ensure that we
keep it a set.
2023-07-18 12:03:54 +00:00
Martin Mathieson 2134cca1a4 AMR: avoid redundant assignment 2023-07-18 12:28:39 +01:00
Guy Harris a6a5707a78 When checking for a 32-bit vs. 64-bit architecture, check for ARM64.
That means that a 64-bit ARM version of Wireshark for Windows will
report that it's running on 64-bit Windows.

(A 64-bit x86 version of Wireshark for Windows, running on an ARM64
system, would, as I read the documentation for GetNativeSystemInfo(),
not be able to reprt that, so we don't bother reporting the instruction
set.)
2023-07-17 21:46:09 -07:00
Guy Harris eac19ab007 Simplify the "is this NT workstation" test.
Pull it into a common routine, and get rid of the old workaround for
MSVC 6 - we had other code that required VER_NT_WORKSTATION to be
defined and required an OSVERSIONINFOEX to have a wProductType member
(not to mention required that there be an OSVERSIONINFOEX structure in
the first place), and it's been compiling just fine.
2023-07-17 19:33:12 -07:00
Guy Harris 889d0d6e6c Fix comment in a typo. [skip ci] 2023-07-17 15:43:45 -07:00
John Thacker 7bfc3f2c13 dumpcap: Add a permissions warning about capabilities
If we have Linux capabilities, and dumpcap gets a permission error,
suggest that the user add the CAP_NET_RAW and CAP_NET_ADMIN capabilities
that dumpcap needs if Wireshark was not installed by a package.
(Distribution packages should set the capabilities.)

Fix #18279
2023-07-17 20:57:23 +00:00
Gerald Combs 76719d21eb CBOR: Add a recursion check
Fixes #19144
2023-07-17 20:07:12 +00:00
Jaap Keuter f307a16d36 Qt: Change handling of folder name text entry
When changing text, don't use the crude method of setting all widgets
where setting of the radio button is sufficient. Setting all widgets
causes the text to be set as well, with cursor at the end of the input.

Closes #19213
2023-07-17 20:01:39 +00:00
Guy Harris 52c45b278e Fix the check for Windows 11 to detect 22H2.
Instead of treating one particular build number as W11, for all OS
versions with a "major version number" of 10, treat all build numbers
less than 10240 as some unknown version, treat build numbers in
[10240,22000) as W10, and all build numbers 22000 and above as W11.

Add comments about other ways of obtaining the OS's "product
name"/"brand name"/whatever that let Microsoft code do a lot of the
heavy lifting, rather than requiring us to do it in a fashion that might
require us to update it.
2023-07-17 12:22:45 -07:00
Pascal Quantin 76e1c8a19f XnAP: fix another test 2023-07-17 17:57:16 +02:00
Martin Mathieson 6a1639c42f XNAP: fix a test 2023-07-17 15:53:02 +00:00
Dave Rigby ee3faeedf9 couchbase: Add support for ReplicaRead subdoc flag
Additional doc_flag for subdoc lookup commands, requests that a
replica vBucket is requested instead of active.
2023-07-17 13:24:31 +00:00
John Thacker f0520511b1 Debian: Add missing symbol
Also remove some symbols that have been moved to wsutil
2023-07-17 07:11:34 -04:00
John Thacker 6f6a8d9b66 epan: Fix crash on columns with many long string fields
ws_label_strcpy, like strlcpy, returns the number of bytes it
would have written in the case of overflow.
proto_item_fill_display_label needs to return the actual number
of bytes copied (which is what protoo_strlcpy does).

Fix #19212
2023-07-16 21:52:51 -04:00
Gerald Combs e3bedc57ba [Automatic update for 2023-07-16]
Update manuf, services enterprise numbers, translations, and other items.
2023-07-16 20:44:43 +00:00
John Thacker dcc9cbffef Qt: Include a checkbox to export without depended upon packets
Add a checkbox to allow users to Export Specified Packets without
including frames which the displayed frames depend upon.

Note that exporting Marked Range and User Range include frames within
the range that any displayed frame depends upon. What we almost surely
want instead is to include any frame that a displayed frame within the
range depends upon. These are often similar, but not the same,
especially at the beginning and end.

Fix #7667
2023-07-16 19:42:19 +00:00
Ismael Mendez Matamoros 39a0efc3ad RTPS: Added CRC32 and MD5 checksum check and deleted unused hfs
Added an option for checking the expected RTPS message
checksum is the same as the received in the wire if
checksum is CRC-32C or MD5. Also delted unused header filters.
Introduced function proto_tree_add_checksum_bytes.
2023-07-16 15:14:52 +00:00
John Thacker 86652cef34 Qt: Fix displayed marked packet count label
In PacketRangeGroupBox, we are accidentally showing the number
of marked packets in the entire capture file in the "Displayed"
column as well.

When actually exporting packets, only the displayed market packets
are exported if that column is selected, but the count shown to
the user is wrong. Fix that.
2023-07-16 10:35:30 +00:00
Martin Mathieson 27035bc9f5 ASN1 dissectors: Avoid returning twice from same function 2023-07-16 08:57:51 +00:00
Martin Mathieson 96b24596d6 file-tiff: Avoid division by zero 2023-07-15 22:26:39 +00:00
John Thacker 2056d7a6ff DICOM: Fix leak in export objects
g_path_get_basename() allocates a new string, which means that it is
a waste to strdup the filename before passing it to the tap and calling
that. The least confusing behavior is to to do all the memory
allocations in dcm_eo_packet, since the Export Object window will
free them when it is closed.

We can change some of the allocations from file scoped to packet
scoped memory, since the dicom_eo_t doesn't need to live any longer
than the packet. Also make the string buffers const, since they are
copied in dcm_eo_packet anyway.
2023-07-15 18:44:00 +00:00
Gerald Combs a7f8bb991e WSUG: Note that we have a foundation. 2023-07-15 09:38:03 -07:00
Jaap Keuter 953cfbd529 DNS: Implement support for A record CH class response
Closes #19203
2023-07-15 14:47:25 +00:00
David Perry 7922b74edf [19131] wslua: make `pinfo.in_error_pkt` writable
Allow lua dissectors to set `pinfo.in_error_pkt`. This allows, for
example, a lua dissector to send an IP header to the IP dissector while
warning it that it is incomplete.

Currently untested!
2023-07-15 13:39:31 +00:00
Nardi Ivan 2fb12ccdcf TLS-utils: fix visualization of "max_ack_delay" transport parameter
Is there a smarter way?

Close #19209
2023-07-15 11:56:40 +00:00
John Thacker 8cee13f912 DICOM: Fix some leaks
The dcm_state_pctx_t and dcm_state_pdv_t objects are created in
file scope. Member strings should be created in the same scope to
avoid leaks.
2023-07-14 21:34:37 -04:00
John Thacker 23ccf8c9a0 codecs: Pass in fmtp, decode bandwidth efficient AMR
Pass the wmem_map of format parameters. Use this to decide whether
we have octet-aligned or bandwidth-efficient AMR, and decode
accordingly.

If we don't have a map of format parameters, because the conversation
wasn't set up by SDP but by Decode As, use the default preferences
from the dissector

Fix #17608
2023-07-14 17:58:19 -04:00
Dr. Lars Völker fd64746f44 Improve consistency of includes 2023-07-14 18:21:18 +00:00
John Thacker 1c386645df RTP Analysis: Fix jitter for packets before the previous one
After 15013ab136, the expected
time of arrival is compared to the previous packet, in an effort
to handle clock changes better. If we're doing so, then there's
some chance that the expected time arrival moves backwards. That's
not a problem for the calculation, so long as we cast to signed
integers at some point.
2023-07-14 18:02:25 +00:00
Elisey Shemyakin 61ef5f7564 Copy DICOM payload to Export Objects window
Payload data for DICOM export object is allocated on the file scope, meaning it
should be freed automatically on capture file close. When Export Objects window
is closed it will attempt to free payload data memory which was allocated by
the DICOM dissector on the file scope. This results in a program crash.
Copying dissector's payload for the Export Objects window fixes #19207
2023-07-14 14:32:12 +00:00
huangqiangxiong 02d2f62b8c Protobuf: improve the speed of loading protobuf language files 2023-07-14 13:30:55 +00:00
Martin Mathieson 0471cc357f MAC-LTE: Fix some value_string conflicts 2023-07-14 10:47:43 +01:00
Gerald Combs 9466415937 Debian: Add missing symbols 2023-07-13 13:00:02 -07:00
Jaap Keuter 17ee2ad57e User Guide: Document preferences 2023-07-13 16:33:45 +00:00
John Thacker ca1a477921 T.38: Support reassembly of more than two data items in a frame
Store information about more than one reassembly in the given frame.

Don't increment additional_hdlc_data_field_counter on every pass,
but use the value from the first pass in the packet data.

Store the data field item number of the first data field in a
reassembly, to identify the fragment sequence number of when in
the first frame of the reassemble.

This produces a consistent set of fragment sequence numbers that
start at 0 and increment by 1, regardless of if there are more than
two data field fragments in a frame, or if there is data starting
a new reassembly in the same frame as a signal end ending a reassembly.

This still doesn't handle the case where more than one reassembly
begins in the same frame (as opposed to one ending and another beginning
in the same frame.) That would require changing the reassembly ID to
be a value guaranteed to increment for each reassembly, instead of
using the frame number of the first fragment.

Fix #12552. Fix #5792.
2023-07-13 07:25:58 -04:00
John Thacker 4b377dd250 IPP: Support both IPP and IPPS
IPP uses the same well known TCP port, 631, for running atop HTTP
(which can upgrade to TLS, RFC 2817) as well as connections that
start out as HTTP over TLS (IPPS, RFC 7472). RFC 8010 notes that
HTTP/2 is also an OPTIONAL transport type.

Despite the clear admonition of RFC 8010 that:
    the "Content-Type" of the message body in each request and response
    MUST be "application/ipp"
many IPP implementations (e.g., on HP printers) often fail to include the
Content-Type in their chunked responses.

So we register IPP in the HTTP port-based dissector so that packets
without a Content-Type will still call the IPP dissector. (Note that
IPP servers commonly will respond to normal HTTP and HTTPS requests
on port 631 just as they would on port 80 or 443, which is why it is
good that we check the Content-Type first. At least those non-IPP
requests and responses seem always to have the Content-Type.)

We can only have a single dissector in the TCP dissector table for port
631. If we don't register a fake helper protocol that tries TLS, HTTP/2,
and HTTP in order, then the others will be recognized heuristically. For
now at least, we are better off having TLS be the dissector set to the port,
because the non-heuristic HTTP dissector never rejects packets. Even when
a packet doesn't look like HTTP and HTTP has never been seen, so the HTTP
dissector doesn't add anything to the tree, it still claims to consume all
the bytes.

When TCP calls a heuristic dissector, pinfo->match_uint does not get
set. If pinfo->match_uint is neither the source nor destination port
(and thus is probably set to IP_PROTO_TCP by the IP dissector), check
the HTTP port subdissector table using the source or destination port,
depending upon whether we have a request or a response.

Fix #18825
2023-07-13 10:57:04 +00:00
John Thacker 8ecb0b53f2 T.38: Don't warn about no pending fragments on retransmissions
If the current packet has the same sequence number as the previous
packet in the same direction on the same conversation, don't add a
Malformed expert info complaining about receiving a fragment end
without any pending fragment data. The fragment data was reassembled
in the previous packet.

For T.38, the new "Ignore duplicate frames" Preference (in Protocols)
added by commit d2c9f1824a is highly
recommended.

Part of #5792 and #12552.
2023-07-12 23:29:06 -04:00
Tomasz Moń 2f0fd3476e USB: Print Darwin frame status only when available
Individual frame status codes can differ from overall request status.
For example when one of the two frames in isochronous IN status code is
kIOReturnNotResponding, then the request status will also be set to
kIOReturnNotResponding regardless of which frame did error.

Do not repeat the request status for all frames as it brings no value
and can actually mislead the user if frames do not share the same status
code.
2023-07-12 19:17:24 +00:00
Tomasz Moń 8ce0d9bc9c USB: Add missing Darwin USB status values
The status values are taken from IOKit IOReturn.h. The value 0xe00002ed
(kIOReturnNotResponding) is reported when timeout occurs on isochronous
IN endpoint.
2023-07-12 19:17:24 +00:00
David Perry 656c01bc53 DTLS: add tree for unknown data
In the DTLS code path for an unrecognized record type, add a tree item
that labels the otherwise-undissected data. The current behaviour claims
that data as part of the parent tree item but without any dissection.

Also add the value for DTLS 1.3 to the `value_string` for SSL versions.
2023-07-12 07:25:41 -04:00
John Thacker a43ba6452a HTTP: Warn if there is extra data after a body
If we call dissect_http_message() a second time in a segment, that
means that the previous message had a Content-Length and more than
enough data to satisfy that Content-Length (so we didn't just slurp
the entire tvb handed to us). If that's the case (original offset > 0),
and the new data doesn't look like the beginning of a request or reply
(that is, a second pipelined request or response), warn the user.
That's probably a bogus Content-Length value.

Fix #15094
2023-07-11 10:53:19 +00:00
John Thacker b285a28467 RTP: Fix if the fmtp comes before rtpmap
Sometimes the SDP has the fmtp before the rtpmap in a media
description. Handle that case.
2023-07-10 20:40:13 -04:00
Gerald Combs 78cc1225b7 Remove services
Remove an empty services file inadvertently added by yesterday's
automatic update.
2023-07-10 21:08:40 +00:00
Markku Leiniö 3ff0902336 DHCPFO: Add Microsoft-specific features
- Add enum preference for autodetecting (or enabling/disabling) Microsoft-
compatibility (default = autodetect)
- Dissect client DHCP scope address (dhcpfo.msclientscope) and hardware address
- Add MS-style IP flags (dhcpfo.msipflags, they do not conform to draft-12)
- Add message digest type 2 as "Microsoft-specific"
- Allow empty message digest (used when message authentication is not
configured)
- Add UTF-16-LE handling for relationship-name and vendor-class options
- Add Microsoft-specific options:
     30 = "microsoft-scope-ID" (dhcpfo.msscopeid)
     33 = "microsoft-scope-netmask" (dhcpfo.msscopenetmask)
     34 = "microsoft-server-IP-address" (dhcpfo.msserverip)

Also show message digest in hex.
2023-07-10 20:18:54 +00:00
John Thacker 725c71b0c2 cfm: Test ID TLV has unusual length (bits not octets)
ITU-T G.8013/Y.1731 9.14.2 indicates that the Length field of a
Test ID TLV "must be 32" even though the Value is a 4-octet Test
ID, and IEEE 802.1Q 21.5 "TLV Format" indicates that the "16 bits
of the Length field indicate the size, in octets, of the Value field."

For this specific TLV type, then, if it is 32, treat it as 4 and
add a note.

Fix #19198
2023-07-10 19:28:17 +00:00
hidd3ncod3s 934e487a3a DCERPC: Fix WKSSVC NetWkstaEnumUsers Request/Response parsing 2023-07-10 19:27:02 +00:00
João Valverde f588214a58 manuf: Improve name shortening heuristic
Add - and + to punctuation exclusion list.

Do not remove the first word as a general term. When an exclusion
term is used as the first word usually it is noa only legalese and
should not be rejected. The exception is "The".
2023-07-10 15:24:47 +01:00
João Valverde f44e088329 manuf: Skip some start words in short name
Skip some locations in company names that are just repeated low-value
information. Many different Chinese companies will short to the same
name (Shenzen for example).

This is a heuristic and not 100% reliable but in the vast majority of
cases it cuts down on noise and generates more informative names.
2023-07-10 15:23:23 +01:00
João Valverde ac57a25ed8 manuf: Increase truncation size to 12
The truncation size of 8 is too short to convey enough information
in many cases. Some experimentation suggests it can be safely
increased for better readability without any other ill effects.

Make a conservative size increase 12. Arguaby it could be larger.
2023-07-10 15:22:36 +01:00
João Valverde 641de5bd0d manuf: Fix indentation
Align the column indentation vertically.
2023-07-10 15:22:05 +01:00