Commit Graph

1374 Commits

Author SHA1 Message Date
João Valverde ae14849864 Windows: Use SpeexDSP binary package
Remove bundled code and use vcpkg binary library instead.
2022-12-16 11:11:28 +00:00
João Valverde 415389eb84 CMake: Update a comment
The stringop-overflow warning is active with both GCC and Clang
in the master branch and was not triggered by our build bots so
update the comment to reflect that.

```
epan/dissectors/packet-lwm.c:464:31: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]
  464 |                     vector[i] ^= text_dec[i];
      |                     ~~~~~~~~~~^~~~~~~~~~~~~~
epan/dissectors/packet-lwm.c:419:21: note: at offset 192 into destination object ‘nwkSecurityVector’ of size 16
  419 |             guint32 nwkSecurityVector[4];
      |                     ^~~~~~~~~~~~~~~~~
```
2022-12-15 03:34:06 +00:00
João Valverde 2d3de008f5 CMake: Disable UTF-8 debug checks for release builds
Disable UTF-8 debug checks for release builds for optimization
purposes.

Also remove unused macro that currently lacks a proper use case.

Change version info to be more complete about the build type without
being too verbose.
2022-12-15 01:57:39 +00:00
João Valverde 400235ad7e CMake: Re-enable -Wno-error=stringop-overflow= 2022-12-15 01:57:39 +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
João Valverde c4ca4312c1 CMake: Add -Werror to sharkd 2022-11-19 23:12:19 +00:00
John Thacker d7ae26bf6c CMake: Update minimum required version to 3.13
Windows already requires CMake 3.13. Bump the non-Windows
required version to 3.13 as well, since all our currently
supported Linux distributions have at least 3.13.

RHEL 8 and SUSE Enterprise 15 were initially released with
3.10 and 3.11, but have had updates with much more recent
versions since mid 2021 and mid 2020, respectively.
2022-11-18 10:05:25 +00:00
João Valverde 18b161c80f CMake: Split "extra" warnings into interesting/not interesting
Add another category for warnings that are worth looking
into.

Split ENABLE_EXTRA_WARNINGS into ENABLE_TODO_WARNINGS and
ENABLE_PEDANTIC_WARNINGS.

Disable pedantic warnings in the CI builds.

Add Clang specific warnings to standard category.

Fix or workaround -Wunreachable warnings.
2022-11-18 10:04:50 +00:00
João Valverde dbb5b80344 CMake: Comment out some warning exceptions 2022-11-17 13:30:33 +00:00
João Valverde e1d492e2e0 CMake: Do not disable -Werror with "extra compiler warnings"
Give the ENABLE_WERROR option full control of -Werror. Silently
overriding the user configuration is potentially confusing and
unnecessary.
2022-11-17 11:22:57 +00:00
João Valverde 973748f321 CMake: Cleanup some compiler flags
Enable -Qunused-arguments because it may be a useful warning.
Remove -fwrapv because it is implied by -fno-strict-overflow.

Move GCC-specific flag out of if(GCC) condition. Let CMake enable
it automatically.
2022-11-17 11:20:57 +00:00
João Valverde 5754fdf289 tfshark: Enable -Werror and fix compiler warnings
Fix a -Wunreachable warning.
2022-11-17 10:57:52 +00:00
João Valverde 4c4b3ec3a9 CMake: Move -Wlogical-op to common flags
It's is valid for C and C++ so move -Wlogical-op to common
flags.

Remove comment because GCC 4.4.5 is over 12 years old at this time,
assume it is outdated.
2022-11-17 01:35:16 +00:00
João Valverde 09718fb9b3 CMake: Move clang warnings
Move clang warnings to normal set. Let the CMake compatibility
check control the warning.

Fix or work-around -Wunreachable warnings in the code.
2022-11-17 01:35:16 +00:00
João Valverde 671bb9f190 CMake: Remove warnings enabled by default
Remove warnings included in -Wall and -Wextra to make the command
line less noisy and speed up CMake invocation.

Remove a -Werror=implicit flag. Let errors be controlled exclusively
by -Werror.

Move some -Wno-foo flags that are only relevant with -Wpedantic.
2022-11-17 01:35:16 +00:00
João Valverde 1ed750dd94 CMake + Gitlab CI: Allow fuzz jobs to pass with warnings
Allow fuzz jobs to pass with warnings because catching warnings is
not their purpose.

Remove -Werror=unused-but-set-variable that was added in
85357ae721 as a work-around to the fact that -Werror is not
enabled as a side-effect of ENABLE_EXTRA_COMPILER_WARNINGS.

Allow users to control -Werror. For example the MSYS2 build
has many warnings, this policy of adding -Werror= breaks that
build.
2022-11-11 14:20:28 +00:00
Gerald Combs 85357ae721 Fix more unused variables and enable unused-but-set-variable errors.
Add -Werror=unused-but-set-variable to our default compiler flags and fix

```
epan/dissectors/packet-dcerpc-frsrpc.c:709:10: error: variable 'nb_chunk' set but not used [-Werror,-Wunused-but-set-variable]
        guint32 nb_chunk = 0;
                ^
```

```
epan/dissectors/packet-dcom-oxid.c:175:13: error: variable 'u32ItemIdx' set but not used [-Werror,-Wunused-but-set-variable]
    guint32 u32ItemIdx;
            ^
```

```
epan/dissectors/packet-l2tp.c:1775:104: error: parameter 'ccid' set but not used [-Werror,-Wunused-but-set-parameter]
static int dissect_l2tp_ericsson_avps(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 ccid)
                                                                                                       ^
```

```
epan/dissectors/packet-ldp.c:1922:19: error: variable 'ix' set but not used [-Werror,-Wunused-but-set-variable]
    guint8        ix;
                  ^
```

```
epan/dissectors/packet-nas_5gs.c:4757:14: error: variable 'curr_len' set but not used [-Werror,-Wunused-but-set-variable]
    guint i, curr_len;
             ^
```

```
epan/dissectors/packet-per.c:1769:6: error: variable 'extension_addition_entries' set but not used [-Werror,-Wunused-but-set-variable]
        int extension_addition_entries;
            ^
```

```
epan/dissectors/packet-rtitcp.c:618:11: error: variable 'messages_count' set but not used [-Werror,-Wunused-but-set-variable]
    guint messages_count, offset;
          ^
```

```
epan/dissectors/packet-tcp.c:2130:9: error: variable 'ackcount' set but not used [-Werror,-Wunused-but-set-variable]
    int ackcount;
        ^
epan/dissectors/packet-tcp.c:3317:12: error: variable 'nbOptionsChanged' set but not used [-Werror,-Wunused-but-set-variable]
    guint8 nbOptionsChanged = 0;
           ^
```

```
epan/dissectors/packet-zbee-zcl-se.c:11802:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
    for (gint i = 0; tvb_reported_length_remaining(tvb, *offset) >= 5; i++) {
              ^
```

```
ui/iface_lists.c:142:23: error: variable 'linktype_count' set but not used [-Werror,-Wunused-but-set-variable]
    gint              linktype_count;
                      ^
```

```
ui/voip_calls.c:456:15: error: variable 'item_num' set but not used [-Werror,-Wunused-but-set-variable]
    guint     item_num;
              ^
```

```
file.c:572:17: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
        guint32 count             = 0;
                ^
```

```
file.c:3667:24: warning: cast from 'const unsigned char *' to 'unsigned char *' drops const qualifier [-Wcast-qual]
        pd = (guint8 *)ws_mempbrk_exec(pd, buf_end - pd, pattern, &c_char);
                       ^
```

```
ui/qt/io_graph_dialog.cpp:1932:60: error: variable 'mavg_right' set but not used [-Werror,-Wunused-but-set-variable]
    unsigned int mavg_in_average_count = 0, mavg_left = 0, mavg_right = 0;
                                                           ^
```

```
ui/qt/stats_tree_dialog.cpp:166:9: error: variable 'node_count' set but not used [-Werror,-Wunused-but-set-variable]
    int node_count = 0;
        ^
```

```
ui/qt/models/profile_model.cpp:1142:13: error: variable 'entryCount' set but not used [-Werror,-Wunused-but-set-variable]
        int entryCount = 0;
            ^
```
2022-11-08 13:49:44 -08:00
John Thacker e449b560c0 epan: Properly generate filter expressions for custom columns
Properly generate filter expressions for custom columns by
using proto_construct_match_selected_string on each value and
then joining them together later instead of trying to split
the column expression value.

This ensures that escaping is done properly for display filter
strings, that commas internal to field values are not confused
with commas between occurrences, that for multifield columns
we can distinguish which field each value matches, etc.

It's not entirely clear whether AND or OR logic is appropriate
for multiple occurrences; currently OR is used.

Bump glib requirement to 2.54 for g_ptr_array_find_with_equal_func
(this doesn't drop support for any major distribution that already
meets our other library requirements, like Qt.)

Fix #18001.
2022-11-02 19:46:11 +00:00
Gerald Combs 83d5533711 GitLab CI: Switch our Linux packages to a twice daily schedule.
The RPM packages use a versioned build directory, which creates problems
for ccache. The APT packages simply take a long time to build. Switch
both to a twice-daily schedule so that we don't set fire to CI minutes
in parallel with every merge.

Back out a recent CMake change since it's no longer needed.
2022-10-21 11:15:22 -07:00
Gerald Combs 139e46898d CMake+GitLab CI: Add and use RPMBUILD_EXTRA_ARGS.
Add an RPMBUILD_EXTRA_ARGS variable to CMakeLists.txt and use it in
GitLab CI to define __cmake_builddir. This should let ccache work with
our RPM builds.
2022-10-20 21:53:37 -07:00
João Valverde 603354203b epan/proto: Replace format text()
The proto.h APIs expect valid UTF-8 so replace uses of format_text()
with a label copy function that just does formatting and does not
check for encoding errors. Avoid multiple levels of temporary
string allocations.

Make sure the copy does not truncate a multibyte character and
produce invalid strings. Add debug checks for UTF-8 encoding errors
instead.

We escape C0 and C1 control codes (because control codes)
and ASCII whitespace (and bell).

Overall the goal is to be more efficient and optimized and help
detect misuse of APIs by passing invalid UTF-8.

Add a unit test for ws_label_strcat.
2022-10-20 20:05:15 +01:00
Guy Harris be60ad9b17 Add include/ws_codepoints.h to the list of public headers. 2022-10-17 00:23:32 -07: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
Gerald Combs 8607946295 CMake: Install falcodump.html in the right place. 2022-10-11 00:41:29 +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 91f7762fad wslua: Use wiretap introspection 2022-10-07 10:28:47 +01:00
João Valverde 58cf815173 CMake: Disable errors with -Wstringop-overflow=
Ping #18383.
2022-10-04 18:17:13 +00:00
Roland Knall 7c8c615efd C-Ares: Move library to 1.13
1.13 is the maximum library for RHEL 8, therefore moving down a
version to ensure compatibility
2022-09-30 14:50:06 +02:00
João Valverde 6d06d4e46b Add some UTF-8 debug checks with a compile time flag
Some older dissectors that predate Unicode and parse text protocols
are prone to generate invalid UTF-8 strings. This is a bug and can have
safety implications.

For example passing invalid UTF-8 to proto_tree_add_string() is a
common bug. There are safeguards in format_text() but this should
not be relied on as a general solution to the problem.

For one, as the name implies, it is only used with representation of a
field value, which is not the same as the value itself of an FT_STRING field.
Issue #18317 shows another reason why.

For now this compile flag only enables extra checks for string ftypes,
which covers a subset of proto.h APIs including
proto_tree_append_string(). Later is should be extended to other
interfaces.

This is also not expected to be disabled for release builds because
there are still many dissectors that do not correctly handle strings.
More work is needed to 1) identify them and 2) fix them.

Ping #18317
2022-09-27 17:04:44 +00: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
Gerald Combs b984e6e29d CMake: Split more Wireshark/Logray variables.
Split our macOS application bundle variables into Wireshark- and
Logray-specific ones. Make sure Logray's PkgInfo and CFBundleSignature
match.
2022-09-01 09:05:58 -07:00
Gerald Combs 5243ffa4c2 extcap: Add falcodump.
Add an extcap that fetches a scap from a Falco/libsinsp plugin. Tested
using the cloudtrail plugin.
2022-08-29 15:35:19 -07:00
João Valverde 867a068332 CMake: Add back a Wireshark env var to configure Qt
Use the variables WIRESHARK_QT{5,6}_PREFIX_PATH.

This allows having Qt5 and Qt6 paths configured isimultaneously and switch easily between them.

Use list(APPEND) to avoid clobbering other CMAKE_PREFIX_PATH paths.

Follow-up to b33210750c.
2022-08-26 09:55:41 +00:00
John Thacker b65b95dda4 CMake: Build test_programs automatically when running test
Since we require CMake version at least 3.7, we can use fixtures
to ensure that the unittests have been built before running
suite_unittests.

This only applies to running the tests via ctest (including
'[ninja|make] test'), not when running pytest directly.

Fix #17191
2022-08-26 00:51:10 +00:00
João Valverde 94da25af6c RPM: Add support for Qt6 and Fedora Linux 2022-08-25 07:54:00 +00:00
João Valverde b33210750c CMake+etc: Enable Qt6 by default for Unix builds
Linux builds were left behind on the Qt transition, presumably because
our Ubuntu CI image does not support Qt6.

Enable Qt6 by default and explicitly disable it for slower or more
conservative Linux distros.

Drop experimental status for Qt6, because we are using it to build
official Windows and macOS releases.
2022-08-22 09:08:06 +00:00
Tomasz Moń 12bb2788f9 CMake: Break on GLib criticals by default in MSVC
Set G_DEBUG=fatal-criticals environment variable when debugging with
Visual Studio. Setting the environment variable conveniently triggers
breakpoint whenever there is a programmer error.
2022-08-17 17:06:57 +00:00
Gerald Combs d2a70cc4ac CMake: Add a Logray patch version. 2022-08-17 16:20:06 +00:00
Gerald Combs 08feb35af0 Version: 3.7.3 → 4.1.0.
[skip ci]
2022-08-15 15:33:00 -07:00
Chuck Craft bbb9610cb3 pluginifdemo: Qt5->Qt6; bump version to 0.0.2 2022-08-15 05:07:46 +00:00
Tomasz Moń c1861ad1cc
extcap: Close capture session after extcap finishes
Wait up to 30 seconds for extcap process to finish after closing pipes.
The wait is achieved in non-blocking fashion, i.e. the UI is completely
responsive during the wait. Only actions related to capture process like
capture control, file open, save, export are inactive during the wait.

On Windows extcap child watch callback gets called immediately as the
process is forcefully terminated. Prior to this change the extcap was
forcefully terminated on Windows anyway.

The wait is possible on UNIX systems if extcap does handle SIGPIPE and
SIGTERM signals. The defaults handlers for SIGPIPE and SIGTERM simply
terminate the process so for large number of extcaps there is no change.
If extcap does not finish within 30 seconds, it is forcefully terminated
using SIGKILL signal.
2022-08-10 06:18:15 +02:00
João Valverde b8ec3199ab Convert Acknowledgements to markdown and update GUI
Move Acknowledgements to a separate file to enable some code
simplification and improve maintenance and discoverability
for acknowlegements.

Convert the Acknowledgements file to Github flavored markdown
and display it in rich text using QTextBrowser.

Add Acknowledgements.md to NSIS installer
2022-08-02 00:09:29 +00:00
Gerald Combs f65fd437dd Fix our version.
Update our version to 3.7.3.

[skip ci]
2022-07-29 10:20:59 -07:00
Gerald Combs 3307397da1 CMake: Set the correct variables for ccache.
As the RULE_LAUNCH_COMPILE documentation says,

"Note: This property is intended for internal use by ctest(1). Projects
and developers should use the <LANG>_COMPILER_LAUNCHER target properties
or the associated CMAKE_<LANG>_COMPILER_LAUNCHER variables instead."
2022-07-25 14:10:39 -07:00
Gerald Combs 49dda8c71e Make Perl optional.
Update our documentation, build configuration, and setup scripts to make
Perl optional.
Closes #18152.
2022-07-23 21:12:25 +00:00
Chuck Craft 26e1d3cdb2 cmake: copy profiles output check
Extend directory path used for RELATIVE comparison.

Closes #18204
2022-07-21 21:31:54 +00:00
Gerald Combs b8d85227f6 Qt: Update the RTP stream UI to support Qt6Multimedia.
Fixes #18115
2022-07-21 20:09:52 +00:00
João Valverde d2b6b89b94 Update license file structure and GUI display
Add the text of the GPLv2 in HTML, taken from the FSF website,
and use rich text to display the license in the GUI.

Move the introductory note about the GPL from the COPYING
license text file to the README.

Remove various other license callouts at the end of the COPYING file
as unnecessary and unhelpful. This information is present in
each source file, where it belongs.
2022-07-21 19:10:06 +00:00
Roland Knall 5991a75d78 ReleasNotes: Add minimum version requirements
Adding an explanation on minimum required versions to the release
notes, as well as bumping c-ares to version 1.14.0

The previous minimum (1.5.0) has been released in 2008. The new
version has been choosen to correlate with those distros, that
also provide a minimum version of Qt5 higher than 5.9, as 5.9
is no longer supported in the main branch
2022-07-21 12:37:17 +00:00