Commit Graph

85544 Commits

Author SHA1 Message Date
Guy Harris 8cca807485 WSDG: tell users not to go for "Qt 6.4 for desktop development".
That will 1) install 6.4, which isn't the recommended LTS version and 2)
install headers and libraries for MinGW-w64, not for Visual Studio.
That means that if you're trying to build with Visual Studio, things
won't work.
2022-10-13 22:40:01 -07:00
John Thacker 790f9eeaa9 PER: Ensure that restricted strings are UTF-8
Use UTF-8 replacement characters for characters outside the
restricted string domain. This is particularly important to
guarantee valid UTF-8 for values outside the ASCII range.

Fix #18423
2022-10-13 21:27:02 -04:00
John Thacker 325506919b epan: Use ws_utf8_truncate for formatted expert infos
Use the convenience function created in 01e2b16ec6
2022-10-13 18:22:44 -04:00
Gerald Combs f10538a102 falcodump: Fix our credential and config file parsing. 2022-10-13 16:32:43 +00:00
Tim Potter b484c41811 wimaxasncp: Fix dissection of message type in packet header
It looks like there was a cut&paste error a long time ago resulting
in the wimaxasncp.message_type field being incorrectly detected as
unused and commented out. Closes #18424.
2022-10-13 14:51:03 +00:00
Dr. Lars Völker 89a3c8679c BLF: Fixing the interpretation of SRR and RTR
This fixes a bug in the canfdmessage64 encoding in BLF that leads to
CAN-FD frames being interpreted as Remote Frames instead of correctly
ignoring the SRR flag. Makes canfdmessage encoding more robust as well.
2022-10-13 14:48:43 +00:00
Dr. Lars Völker 883bc6ef29 TECMP: improve FCS and Padding detection for Ethernet
This patch fixes some bugs that occur with padded Ethernet frames
or Ethernet frames with FCS present.
2022-10-13 14:47:12 +00:00
John Thacker 9891a79137 nbt: Check NetBIOS scope IDs
RFC 1001 says that scope IDs "meet the restricted character set
of the domain system and has a leading period." Convert them from
ASCII (plus possible garbage fuzzed characters) to UTF-8. Also
check for truncation when appending them to the NetBIOS name.

Fix #18412
2022-10-13 12:04:16 +00:00
Michael Tuexen 41fdfcdbfb SCTP: Improve handling of Host Name parameters 2022-10-13 10:14:00 +00:00
Patricia Lindner ceed050c47 LTP: Enhance with generated items, sequence analysis, and statistics
This change adds computed values for reports, sequence analysis between
segments, conversation and endpoint taps, and a new statistics menu
and dialog.
2022-10-13 09:30:55 +00:00
João Valverde 101ad8f29e Github CI: Add MSYS2 build
Ping #17771.
2022-10-13 08:08:11 +00:00
João Valverde c01545ef7c msys2-setup.sh: Add missing git package 2022-10-13 08:08:11 +00:00
John Thacker 900984b3b7 smb: Fix display_unicode_string
In SMB, display_unicode_string is used to handle null terminated
UTF-16LE strings. Do that with the normal API, instead of just
taking every other byte (which works for ASCII and nothing else.)

Do the same fix for the DirectPlay dissector, which borrowed the
code from SMB

Fix #18467.
2022-10-12 23:52:03 -04:00
John Thacker 01e2b16ec6 wsutil/str_util: Add ws_utf8_truncate
Add a convenience function to truncate a UTF-8 string to no more
than certain length, while ensuring that the string ends with
a complete character instead of a partial sequence (by truncating
up to 3 additional bytes as necessary.)

The common use case is when a valid UTF-8 string is copied into
a buffer via snprintf, strlcpy, or strlcat and truncated, to fix
up the end of the string and keep the string valid.

The buffer holding the string must be large enough, and the string
must be valid up to the point of truncation (aside from the possible
partial sequence at the end). For speed, the function does not check
those conditions.

Ping #18412.
2022-10-12 23:21:18 -04:00
John Thacker 87441e45d8 Qt: minizip and minizip-ng size compatibility issues
MS-DOS Date and MS-DOS Time are packed 16-bit values
(https://learn.microsoft.com/en-us/windows/win32/sysinfo/ms-dos-date-and-time)
and when combined they make a 32-bit value.

In the original minizip that comes with zlib, the combined dosDate
parameter is a uLong, which is 64 bits on LP64 platforms. In minizip-ng,
it is a uint32_t.

At one point, minizip-ng renamed the dosDate struct member of
zip_fileinfo to dos_date, but more recent versions changed it back
to dosDate for compatibility, except the size remains different,
so our compatibility check can't distinguish the size.

clang (and possibly other compilers) complain about shortening a 64 bit
unsigned long to a uint32_t so make the return value from our
qDateToDosDate a uint32_t as it should be to avoid warnings on
distributions with minizip-ng

Also the maximum year value that can be stored in the format is
127, since it occupies bits 9-15 of the MS-DOS Date. (There was
probably some confusion since the maximum year is 2107, but its
offset from 1980, not 1900.)
2022-10-12 22:03:34 -04:00
Chuck Craft 3c0936d83e Github actions: newer verions with node12 -> node16
Ping #18462
2022-10-12 20:32:37 +00:00
João Valverde d99426fa6a GVCP: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 17:35:30 +01:00
João Valverde 9a16cda9c7 HICP: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 17:33:34 +01:00
João Valverde a0a2386f74 LISP: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 10:58:22 +01:00
João Valverde 803edf3f72 Homeplug AV: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 10:55:41 +01:00
João Valverde 8ad9561f22 Open Sound Control: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 09:25:23 +00:00
João Valverde a05b210e11 F5 Ethtrailer: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 09:25:23 +00:00
João Valverde 411289eaca IEEE 17221: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 09:25:23 +00:00
João Valverde af36a6ffcc ELF: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 09:25:23 +00:00
Guy Harris 670bacedc9 Match declaration style of other functions.
All other functions are declared with two lines:

    WS_DLL_PUBLIC <type>
    <function_name(<args>);

Declare wtap_block_foreach_option() that  way, too, for consistency.
2022-10-12 01:25:04 -07:00
Guy Harris f7422a5cc8 Use "a" before consonant sounds, use "an" before vowel sounds. 2022-10-11 23:53:03 -07:00
Guy Harris 4653583e1e Separate cases with spaces.
All other cases in that switch statement have spaces between them; add
one before this one.
2022-10-11 22:41:18 -07:00
John Thacker 5bc8cac5cc charsets: UCS-4 code points above 0x10FFFFF are not legal
When decoding UCS-4/UTF-32, map Unicode code points above
0x10FFFFF to REPLACEMENT CHARACTER, as they are not legal,
and would create invalid UTF-8.
Also if the number of bytes given is not a multiple of 4,
insert a replacement character at the end as well.

This is two long standing todos. Fixes #18435.
2022-10-11 20:40:09 -04:00
John Thacker 78ce2f2907 HTTP: Validate Basic Auth against UTF-8 after Base64 decoding
The result of Base64 decoding might not be valid UTF-8, so
check it as such. Also add the decoded result as a new tvb data
source, so that it's easier to do other manipulations on it from
the GUI in case it isn't UTF-8.

Note that RFC 7617 says that the encoding is only known to be
UTF-8 if the charset parameter was used in the WWW-Authenticate
header, so perhaps this should be a FT_BYTES using
BASE_SHOW_UTF_8_PRINTABLE

Fix #18408
2022-10-11 23:19:11 +00:00
Alexis La Goutte ec767dcf2d ieee80211: Use gint(8) for Beamforming Report AVG SNR
Fix #18436
2022-10-11 18:35:10 +00:00
João Valverde 16fad42ae4 wslog: rename console open preference enum 2022-10-11 18:11:35 +01:00
João Valverde f2fd5ab201 wslog: Fix console_open registry key name
Fix "OpenConsole" registry key to "ConsoleOpen".

Add a common macro for the key name.
2022-10-11 18:10:35 +01:00
Gerald Combs f3f1556d45 Qt: Properly truncate our FieldInformation strings.
As the Qt6 QString::QString(const QByteArray &ba) documenation says:

"Note: any null ('\0') bytes in the byte array will be included in this
string, converted to Unicode null characters (U+0000). This behavior is
different from Qt 5.x."

Make sure FieldInformation::toString() truncates its display label byte
array before converting it to a QString.

Fixes #18428
2022-10-11 16:59:32 +00:00
João Valverde a19834b98c Windows: Store "gui.console_open" in the Windows registry
This removes the last dependency of the logging subsystem on the
preferences module. The latter is started much later than the former
and this is an issue.

The Windows-only preference "gui.console_open" is stored in the
registry as HKEY_LOCAL_USER\Software\Wireshark\ConsoleOpen. The semantics
are exactly the same. The preference is read by the logging subsystem
for initialization and then again by the preferences (read/write) so
the user can configure it as before.

The code to store the preference also in the preferences file was
kept, for backward compatibility and because it is not incompatible
with using the Registry concurrently.

The elimination of the prefs dependency also allows moving the Windows
console logic to wsutil and add the functionality to wslog directly,
thereby eliminating the superfluous Wireshark/Logray custom log handler.

To be able to read the ws_log_console_open global variable from
libwireshark it becomes necessary to add a new export macro
symbol called WSUTIL_EXPORT.
2022-10-11 14:25:04 +01:00
João Valverde 44d1cc6d4a GUI: Move log message to the correct place
Move the log message after parse_args().
2022-10-11 14:23:19 +01:00
Dirk Ziegelmeier 8f7d0b2af5 Fix issue #18391
Profinet PNIO-CM Connect Response Error Decode Incorrect
2022-10-11 11:28:54 +00:00
John Thacker b7249fadd9 epan: Handle truncation of expert infos in the middle of UTF-8 chars
If the formatted string generated by expert_add_info_format is
truncated by being larger than ITEM_LABEL_LENGTH, it might get
truncated in the middle of a multibyte UTF-8 character.
Check for that, and end the string where the partial character
starts.

Fix #18421
2022-10-11 10:11:58 +00:00
Gerald Combs 8700e9c407 wiretap: Make some pcapng logs noisy.
Switch some pcapng log messages from debug to noisy.
2022-10-11 07:10:16 +00:00
Martin Mayer cf45609c02 OCP.1: Added packet forward lookup 2022-10-11 07:09:22 +00:00
Dylan Ulis 5f9d493640 CIP: Support object-specific services 2022-10-11 07:07:12 +00:00
zhangzhilei f7416d7e95 change GMTLS to TLCP
GMTLS is a non-official name, now that these is a Chinese National Standard called
"GB/T 38636-2020 Information security technology—Transport layer cryptography protocol(TLCP)"
so we replace GMTLS by TLCP
2022-10-11 12:48:29 +08:00
João Valverde 4a0ba1e378 WSDG: Make commands easily copy-pasteable
Removing the artificial shell prompt symbols does not hurt
legibility and makes is significantly easier to copy-paste
commands, either by double-clicking for a single line or
click and drag for a multiline block of text.
2022-10-11 00:48:07 +00:00
Gerald Combs 8607946295 CMake: Install falcodump.html in the right place. 2022-10-11 00:41:29 +00:00
Gerald Combs 7896f4b292 falcodump: Fixup our default profile and region.
Make sure we fetch AWS_PROFILE if it exists. Don't add AWS_PROFILE or
AWS_REGION if they're already in the profile and region lists. Fix our
default values.
2022-10-11 00:40:54 +00:00
Guy Harris 3db17dab82 transum: expert infos are not Boolean fields.
They're of type FT_NONE, meaning that they do not have values, they're
just present or not.

Handle the TCP analysis fields "tcp.analysis.retransmission" and
"tcp.analysis.keep_alive", both of which are expert infos, by just
seeing if they're present or not.

Fixes a problem mentioned in a comment in merge request !8412.
2022-10-10 16:00:53 -07:00
João Valverde 597f020793 epan: Mark tvb_get_const_stringz() as deprecated
The function tvb_get_const_stringz() does not check for a string
encoding and returns a pointer to a byte array. For this reason
it should not be used. Prefer other functions that return a
valid UTF-8 string from a source encoding or use tvb_get_ptr()
to fetch a byte pointer.
2022-10-10 20:27:33 +00:00
João Valverde 1b12dc4b9e Add WS_DEPRECATED_X() function attribute
This adds a new attribute that allows declaring Wireshark
functions as deprecated.

Also disabe -Werror with deprecated declarations  Deprecated
declarations can be introduced suddenly with a new version
of an external dependency or a new internal deprecation and
that has its own timeline to fix. We should still be able to
build with -Werror in that case.
2022-10-10 20:27:33 +00:00
João Valverde 3b803a94c7 ftypes: Cleanup code to parse integers
Replace strtol/strtoul with the glib functions that do
not have a locale dependency.

Cleanup some casts and print formats. Remove some code
duplication. Add some null checks.

Rename a function for consistency.
2022-10-10 17:24:52 +00:00
João Valverde 2fdd9d2e5d Windows: Fix detection of asciidoctor again
Scoop uses "asciidoctorj.cmd". The others were added for
completeness.
2022-10-10 16:37:53 +00:00
Alexis La Goutte 5a86ac3149 follow_stream_dialoag(qt): Fix Clang Analyzer Warning
Fix 3rd function call argument is an uninitialized value

stream_count is not longer initialized for QUIC (after g2762c64010 remove like other)
2022-10-10 11:57:29 +00:00