New version 4.2.2

This commit is contained in:
Michal Ruprich 2024-02-01 10:06:23 +01:00
parent c48825402c
commit 4cdb9e8c1c
9 changed files with 46 additions and 541 deletions

View File

@ -1,2 +1,2 @@
SHA512 (wireshark-4.0.8.tar.xz) = f6de0f86bb1eac82f7ed2d98d7f4fe3189107b1f0da441abd9077593f8e624989c33aaf8b4ef4b3c460fe787c64c4b8fdb3168de9f5661802fed6b06d71c5c65
SHA512 (SIGNATURES-4.0.8.txt) = 7da9141c6b0768121245df9e19eebb4976e2f5f16811730cd03f4088efae5fe21ec43563ff9cc68c5089722c1e4d2d90817dbd5b0c55e36a4851c0b3184d5249
SHA512 (wireshark-4.2.2.tar.xz) = a72c4957c7458da85ec9d121330c0c185fa047823b00be88e1218efda5ce43a7e4a3581afefadc003f376da8b89668d835bbead049009a1fdb5d8fbce08ddbb2
SHA512 (SIGNATURES-4.2.2.txt) = f4b8c98ecac26353a41405fea532301a50244827c3d1f71bbde4cf46f9ef47f13019b0cadf1a946bdaf8e7e99363664316d4ccbe389f4bbd4a6416efcdd72f16

View File

@ -1,55 +1,22 @@
From: Jan Safranek <jsafrane@redhat.com>
Date: Fri, 26 Nov 2010 14:30:45 +0300
Subject: [PATCH] Customize 'permission denied' error.
Add Fedora-specific message to error output when dumpcap cannot be started
because of permissions.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
diff --git a/capture/capture_sync.c b/capture/capture_sync.c
index 47a30a70c4..84d19568b0 100644
index af08b32..2e0fcb7 100644
--- a/capture/capture_sync.c
+++ b/capture/capture_sync.c
@@ -336,6 +336,7 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments,
gchar *signal_pipe_name;
#else
char errmsg[1024+1];
+ const char *securitymsg = "";
int sync_pipe[2]; /* pipe used to send messages from child to parent */
enum PIPES { PIPE_READ, PIPE_WRITE }; /* Constants 0 and 1 for PIPE_READ and PIPE_WRITE */
#endif
@@ -741,8 +742,10 @@ sync_pipe_start(capture_options *capture_opts, GPtrArray *capture_comments,
dup2(sync_pipe[PIPE_WRITE], 2);
ws_close(sync_pipe[PIPE_READ]);
execv(argv[0], argv);
- snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
- argv[0], g_strerror(errno));
+ if (errno == EPERM || errno == EACCES)
+ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root.";
+ snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s",
+ argv[0], g_strerror(errno), securitymsg);
sync_pipe_errmsg_to_parent(2, errmsg, "");
/* Exit with "_exit()", so that we don't close the connection
@@ -846,6 +849,7 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
int i;
#else
char errmsg[1024+1];
+ const char *securitymsg = "";
int sync_pipe[2]; /* pipe used to send messages from child to parent */
int data_pipe[2]; /* pipe used to send data from child to parent */
#endif
@@ -994,8 +998,10 @@ sync_pipe_open_command(char* const argv[], int *data_read_fd,
ws_close(sync_pipe[PIPE_READ]);
ws_close(sync_pipe[PIPE_WRITE]);
execv(argv[0], argv);
- snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
- argv[0], g_strerror(errno));
+ if (errno == EPERM || errno == EACCES)
+ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root.";
+ snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s",
+ argv[0], g_strerror(errno), securitymsg);
sync_pipe_errmsg_to_parent(2, errmsg, "");
/* Exit with "_exit()", so that we don't close the connection
@@ -1825,8 +1832,16 @@ sync_pipe_input_cb(GIOChannel *pipe_io, capture_session *cap_session)
if (!ws_strtoi32(buffer, NULL, &exec_errno)) {
ws_warning("Invalid errno: %s", buffer);
}
- primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s",
+ if (exec_errno == EPERM || exec_errno == EACCES) {
+ const char *securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root.";
+ primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s%s",
+ g_strerror(exec_errno), securitymsg);
+ }
+ else {
+ primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s",
g_strerror(exec_errno));
+ }
+
cap_session->error(cap_session, primary_msg, NULL);
/* the capture child will close the sync_pipe, nothing to do for now */
/* (an error message doesn't mean we have to stop capturing) */

View File

@ -31,7 +31,7 @@ index 752b669ac4..42c2be0fca 100644
#include <QDesktopServices>
#include <QUrl>
@@ -185,7 +186,7 @@ FolderListModel::FolderListModel(QObject * parent):
appendRow(QStringList() << tr("\"File\" dialogs") << get_last_open_dir() << tr("capture files"));
appendRow(QStringList() << tr("\"File\" dialogs") << get_open_dialog_initial_dir() << tr("capture files"));
/* temp */
- appendRow(QStringList() << tr("Temp") << (global_capture_opts.temp_dir && global_capture_opts.temp_dir[0] ? global_capture_opts.temp_dir : g_get_tmp_dir()) << tr("untitled capture files"));
@ -86,16 +86,20 @@ index 591a63bbf3..203f5c5286 100644
} else {
sample_file_ = new QBuffer(this);
diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c
index f93f96d538..73964a1def 100644
index 531ed91..bd6fd60 100644
--- a/wsutil/tempfile.c
+++ b/wsutil/tempfile.c
@@ -14,10 +14,12 @@
@@ -10,6 +10,8 @@
#include "config.h"
#include "tempfile.h"
#include "file_util.h"
+#include <wsutil/file_util.h>
+#include <wsutil/wstmpdir.h> /* for get_tmp_dir() */
#include <errno.h>
@@ -39,7 +41,7 @@ sanitize_prefix(const char *prefix)
/**
* Create a tempfile with the given prefix (e.g. "wireshark"). The path
- * is created using g_file_open_tmp.
@ -103,18 +107,17 @@ index f93f96d538..73964a1def 100644
*
* @param tempdir [in] If not NULL, the directory in which to create the file.
* @param namebuf [in,out] If not NULL, receives the full path of the temp file.
@@ -33,6 +33,9 @@ create_tempfile(const char *tempdir, gchar **namebuf, const char *pfx, const cha
@@ -55,13 +57,25 @@ create_tempfile(const char *tempdir, char **namebuf, const char *pfx, const char
{
int fd;
gchar *safe_pfx = NULL;
char *safe_pfx = sanitize_prefix(pfx);
+ gchar *tmp_file;
+ const char *tmp_dir;
+ int old_mask;
if (pfx) {
/* The characters in "delimiters" come from:
@@ -54,7 +57,16 @@ create_tempfile(const char *tempdir, gchar **namebuf, const char *pfx, const cha
gchar* filetmpl = ws_strdup_printf("%sXXXXXX%s", safe_pfx ? safe_pfx : "", sfx ? sfx : "");
if (tempdir == NULL || tempdir[0] == '\0') {
/* Use OS default tempdir behaviour */
char* filetmpl = ws_strdup_printf("%sXXXXXX%s", safe_pfx ? safe_pfx : "", sfx ? sfx : "");
g_free(safe_pfx);
- fd = g_file_open_tmp(filetmpl, namebuf, err);

View File

@ -4,15 +4,15 @@ index a55086c..0149801 100644
+++ b/wsutil/CMakeLists.txt
@@ -80,6 +80,7 @@ set(WSUTIL_PUBLIC_HEADERS
ws_roundup.h
ws_return.h
ws_strptime.h
wsgcrypt.h
+ wstmpdir.h
wsjson.h
wslog.h
xtea.h
@@ -135,6 +136,7 @@ set(WSUTIL_COMMON_FILES
ws_mempbrk.c
ws_pipe.c
ws_strptime.c
wsgcrypt.c
+ wstmpdir.c
wsjson.c

View File

@ -1,13 +0,0 @@
diff --git a/ui/qt/wireshark_main_window_slots.cpp b/ui/qt/wireshark_main_window_slots.cpp
index 0594ff6..3068797 100644
--- a/ui/qt/wireshark_main_window_slots.cpp
+++ b/ui/qt/wireshark_main_window_slots.cpp
@@ -2513,7 +2513,7 @@ void WiresharkMainWindow::showHideMainWidgets(QAction *action)
if (widget == toolbar) {
GList *entry = g_list_find_custom(recent.interface_toolbars, action->text().toUtf8(), (GCompareFunc)strcmp);
if (show && !entry) {
- recent.interface_toolbars = g_list_append(recent.interface_toolbars, g_strdup(action->text().toUtf8()));
+ recent.interface_toolbars = g_list_append(recent.interface_toolbars, g_strdup(action->text().toUtf8().constData()));
} else if (!show && entry) {
recent.interface_toolbars = g_list_remove(recent.interface_toolbars, entry->data);
}

View File

@ -1,213 +0,0 @@
From 601bf39e6b2eaff9e77588ff1b1a8a987dad404d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= <j@v6e.pt>
Date: Fri, 26 May 2023 14:16:06 +0100
Subject: [PATCH] CMake: Remove module LocatePythonModule.cmake
This module is unnecessary and frequently causes hard-to-debug
issues during CMake's configure run. Nuke it.
---
cmake/modules/LocatePythonModule.cmake | 53 --------------------------
cmake/modules/UseAsn2Wrs.cmake | 13 ++-----
cmake/modules/UseMakePluginReg.cmake | 7 +---
3 files changed, 6 insertions(+), 67 deletions(-)
delete mode 100644 cmake/modules/LocatePythonModule.cmake
diff --git a/cmake/modules/LocatePythonModule.cmake b/cmake/modules/LocatePythonModule.cmake
deleted file mode 100644
index 3fbe0c7..0000000
--- a/cmake/modules/LocatePythonModule.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-#LOCATE_PYTHON_MODULE(<module> [PATHS <path1> ... <pathN>] [REQUIRED])
-#
-# This function tries to find the given python module.
-# If found the path is provided in <PY_<module> and <<module>_FOUND> is set to TRUE.
-#
-# After PATHS additional paths for python to search can be provided.
-# When REQUIRED is set, the function will abort the cmake execution is the module is not found
-function(LOCATE_PYTHON_MODULE module)
- if(NOT PYTHON_EXECUTABLE)
- find_package(PythonInterp)
- endif()
-
- # Parse (additional) arguments
- set(options REQUIRED)
- set(multiValueArgs PATHS)
- cmake_parse_arguments(LPM "${options}" "" "${multiValueArgs}" ${ARGN})
-
- string(TOUPPER ${module} module_upper)
- if(NOT PY_${module_upper})
-
- if(LPM_PATHS)
- # Append LPM_PATHS to PYTHONPATH to search at provided location (first)
- file(TO_CMAKE_PATH "$ENV{PYTHONPATH}" CMAKE_PATH)
- list(INSERT CMAKE_PATH 0 ${LPM_PATHS})
- file(TO_NATIVE_PATH "${CMAKE_PATH}" NATIVE_PATH)
- if(UNIX)
- string(REPLACE ";" ":" NATIVE_PATH "${NATIVE_PATH}")
- endif(UNIX)
- set(ENV{PYTHONPATH} "${NATIVE_PATH}")
- endif(LPM_PATHS)
-
- # Use the (native) python impl module to find the location of the requested module
- execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
- "import imp; print(imp.find_module('${module}')[1])"
- RESULT_VARIABLE _${module}_status
- OUTPUT_VARIABLE _${module}_location
- ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-
- if(NOT _${module}_status)
- set(PY_${module_upper} ${_${module}_location} CACHE STRING
- "Location of Python module ${module}")
- set(${module_upper}_FOUND TRUE)
- message(STATUS "Found python module ${module}: ${PY_${module_upper}}")
- else(NOT _${module}_status)
- set(${module_upper}_FOUND FALSE)
- if(LPM_REQUIRED)
- message(FATAL_ERROR "Could NOT find python module ${module}")
- else(LPM_REQUIRED)
- message(STATUS "Could NOT find python module ${module}")
- endif(LPM_REQUIRED)
- endif(NOT _${module}_status)
- endif(NOT PY_${module_upper})
-endfunction(LOCATE_PYTHON_MODULE)
diff --git a/cmake/modules/UseMakePluginReg.cmake b/cmake/modules/UseMakePluginReg.cmake
index e6e6a91..fe57381 100644
--- a/cmake/modules/UseMakePluginReg.cmake
+++ b/cmake/modules/UseMakePluginReg.cmake
@@ -1,20 +1,17 @@
#
function(register_plugin_files _outputfile _registertype)
- include(LocatePythonModule)
- locate_python_module(make-plugin-reg REQUIRED PATHS ${CMAKE_SOURCE_DIR}/tools)
-
file(RELATIVE_PATH output "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/${_outputfile}")
add_custom_command(
OUTPUT
${_outputfile}
COMMAND ${PYTHON_EXECUTABLE}
- ${PY_MAKE-PLUGIN-REG}
+ ${CMAKE_SOURCE_DIR}/tools/make-plugin-reg.py
${CMAKE_CURRENT_SOURCE_DIR}
${_registertype}
${ARGN}
COMMENT "Generating ${output}"
DEPENDS
${ARGN}
- ${PY_MAKE-PLUGIN-REG}
+ ${CMAKE_SOURCE_DIR}/tools/make-plugin-reg.py
)
endfunction()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6db2e46..21e71e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3825,7 +3825,6 @@ install(
${WS_CMAKE_MODULE_PATH}/FindWSLibrary.cmake
${WS_CMAKE_MODULE_PATH}/FindWSWinLibs.cmake
${WS_CMAKE_MODULE_PATH}/UseAsn2Wrs.cmake
- ${WS_CMAKE_MODULE_PATH}/LocatePythonModule.cmake
${WS_CMAKE_MODULE_PATH}/UseMakePluginReg.cmake
DESTINATION
${WIRESHARK_INSTALL_CMAKEDIR}
diff --git a/cmake/modules/FindAsciidoctor.cmake b/cmake/modules/FindAsciidoctor.cmake
index 67cbc8d..929a4eb 100644
--- a/cmake/modules/FindAsciidoctor.cmake
+++ b/cmake/modules/FindAsciidoctor.cmake
@@ -124,7 +124,7 @@ if(ASCIIDOCTOR_EXECUTABLE)
ADD_CUSTOM_COMMAND(
OUTPUT
${_output_txt}
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
${_output_html}
> ${_output_txt}
DEPENDS
diff --git a/cmake/modules/UseMakePluginReg.cmake b/cmake/modules/UseMakePluginReg.cmake
index fe57381..0c7198d 100644
--- a/cmake/modules/UseMakePluginReg.cmake
+++ b/cmake/modules/UseMakePluginReg.cmake
@@ -4,7 +4,7 @@ function(register_plugin_files _outputfile _registertype)
add_custom_command(
OUTPUT
${_outputfile}
- COMMAND ${PYTHON_EXECUTABLE}
+ COMMAND ${Python3_EXECUTABLE}
${CMAKE_SOURCE_DIR}/tools/make-plugin-reg.py
${CMAKE_CURRENT_SOURCE_DIR}
${_registertype}
diff --git a/cmake/modules/UseMakeTaps.cmake b/cmake/modules/UseMakeTaps.cmake
index aed9318..56fd628 100644
--- a/cmake/modules/UseMakeTaps.cmake
+++ b/cmake/modules/UseMakeTaps.cmake
@@ -5,7 +5,7 @@ MACRO(REGISTER_TAP_FILES _outputfile)
OUTPUT
${_outputfile}
COMMAND
- ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py taps ${_outputfile} ${_sources}
+ ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-regs.py taps ${_outputfile} ${_sources}
DEPENDS
${CMAKE_SOURCE_DIR}/tools/make-regs.py
${_sources}
diff --git a/cmake/modules/UseAsn2Wrs.cmake b/cmake/modules/UseAsn2Wrs.cmake
index 9d7cdfe..6b0c46c 100644
--- a/cmake/modules/UseAsn2Wrs.cmake
+++ b/cmake/modules/UseAsn2Wrs.cmake
@@ -6,11 +6,6 @@
# absolute path (e.g. "${CMAKE_CURRENT_SOURCE_DIR}").
function(ASN2WRS)
- if(NOT PY_ASN2WRS)
- include(LocatePythonModule)
- locate_python_module(asn2wrs REQUIRED PATHS "${CMAKE_SOURCE_DIR}/tools")
- endif()
-
if(NOT PROTO_OPT)
set(PROTO_OPT -p ${PROTOCOL_NAME})
elseif(PROTO_OPT STREQUAL "_EMPTY_")
@@ -38,8 +33,8 @@ function(ASN2WRS)
# Creates a dissector in the source directory and store the timestamp.
add_custom_command(
OUTPUT packet-${PROTOCOL_NAME}-stamp
- COMMAND "${PYTHON_EXECUTABLE}"
- ${PY_ASN2WRS}
+ COMMAND "${Python3_EXECUTABLE}"
+ ${CMAKE_SOURCE_DIR}/tools/asn2wrs.py
${A2W_FLAGS}
${PROTO_OPT}
-c "${CMAKE_CURRENT_SOURCE_DIR}/${PROTOCOL_NAME}.cnf"
@@ -48,12 +43,12 @@ function(ASN2WRS)
-O "${A2W_OUTPUT_DIR}"
${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE}
COMMAND
- "${PYTHON_EXECUTABLE}" -c
+ "${Python3_EXECUTABLE}" -c
"import shutil, sys; x,s,d=sys.argv; open(d, 'w'); shutil.copystat(s, d)"
"${A2W_OUTPUT_DIR}/packet-${PROTOCOL_NAME}.c"
packet-${PROTOCOL_NAME}-stamp
DEPENDS
- "${PY_ASN2WRS}"
+ ${CMAKE_SOURCE_DIR}/tools/asn2wrs.py
${SRC_FILES}
${EXTRA_CNF_targets}
${EXTRA_CNF}
@@ -67,8 +62,8 @@ function(ASN2WRS)
foreach(_asn2wrs_export_file IN LISTS EXPORT_FILES)
add_custom_command(
OUTPUT ${_asn2wrs_export_file}
- COMMAND "${PYTHON_EXECUTABLE}"
- "${PY_ASN2WRS}"
+ COMMAND "${Python3_EXECUTABLE}"
+ ${CMAKE_SOURCE_DIR}/tools/asn2wrs.py
-E
${A2W_FLAGS}
${PROTO_OPT}
@@ -76,7 +71,7 @@ function(ASN2WRS)
-D "${CMAKE_CURRENT_SOURCE_DIR}"
${EXT_ASN_FILE_LIST} ${ASN_FILE_LIST} ${EXT_ASN_FILE_LIST_LATE}
DEPENDS
- "${PY_ASN2WRS}"
+ ${CMAKE_SOURCE_DIR}/tools/asn2wrs.py
${SRC_FILES}
${EXPORT_DEPENDS_targets}
${EXPORT_DEPENDS}

View File

@ -1,164 +0,0 @@
diff --git a/capinfos.c b/capinfos.c
index 3c7866befd..da576f88c5 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -141,7 +141,6 @@ static gboolean cap_file_hashes = TRUE; /* Calculate file hashes */
// Strongest to weakest
#define HASH_SIZE_SHA256 32
-#define HASH_SIZE_RMD160 20
#define HASH_SIZE_SHA1 20
#define HASH_STR_SIZE (65) /* Max hash size * 2 + '\0' */
@@ -743,7 +742,6 @@ print_stats(const gchar *filename, capture_info *cf_info)
}
if (cap_file_hashes) {
printf ("SHA256: %s\n", file_sha256);
- printf ("RIPEMD160: %s\n", file_rmd160);
printf ("SHA1: %s\n", file_sha1);
}
if (cap_order) printf ("Strict time order: %s\n", order_string(cf_info->order));
@@ -857,7 +855,6 @@ print_stats_table_header(void)
if (cap_packet_rate) print_stats_table_header_label("Average packet rate (packets/sec)");
if (cap_file_hashes) {
print_stats_table_header_label("SHA256");
- print_stats_table_header_label("RIPEMD160");
print_stats_table_header_label("SHA1");
}
if (cap_order) print_stats_table_header_label("Strict time order");
@@ -1182,7 +1179,6 @@ calculate_hashes(const char *filename)
}
gcry_md_final(hd);
hash_to_str(gcry_md_read(hd, GCRY_MD_SHA256), HASH_SIZE_SHA256, file_sha256);
- hash_to_str(gcry_md_read(hd, GCRY_MD_RMD160), HASH_SIZE_RMD160, file_rmd160);
hash_to_str(gcry_md_read(hd, GCRY_MD_SHA1), HASH_SIZE_SHA1, file_sha1);
}
if (fh) fclose(fh);
@@ -1489,7 +1485,7 @@ print_usage(FILE *output)
fprintf(output, " -E display the capture file encapsulation\n");
fprintf(output, " -I display the capture file interface information\n");
fprintf(output, " -F display additional capture file information\n");
- fprintf(output, " -H display the SHA256, RIPEMD160, and SHA1 hashes of the file\n");
+ fprintf(output, " -H display the SHA256 and SHA1 hashes of the file\n");
fprintf(output, " -k display the capture comment\n");
fprintf(output, "\n");
fprintf(output, "Size infos:\n");
@@ -1842,10 +1838,9 @@ main(int argc, char *argv[])
if (cap_file_hashes) {
gcry_check_version(NULL);
gcry_md_open(&hd, GCRY_MD_SHA256, 0);
- if (hd) {
- gcry_md_enable(hd, GCRY_MD_RMD160);
+ if (hd)
gcry_md_enable(hd, GCRY_MD_SHA1);
- }
+
hash_buf = (char *)g_malloc(HASH_BUF_SIZE);
}
diff --git a/doc/capinfos.adoc b/doc/capinfos.adoc
index 16ed2e300a..124fb56694 100644
--- a/doc/capinfos.adoc
+++ b/doc/capinfos.adoc
@@ -200,7 +200,7 @@ Prints the help listing and exits.
-H::
+
--
-Displays the SHA256, RIPEMD160, and SHA1 hashes for the file.
+Displays the SHA256 and SHA1 hashes for the file.
SHA1 output may be removed in the future.
--
diff --git a/capinfos.c b/capinfos.c
index f0059f4e54..e153097219 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -148,7 +148,6 @@ static gboolean cap_file_hashes = TRUE; /* Calculate file hashes */
static gchar file_sha256[HASH_STR_SIZE];
-static gchar file_rmd160[HASH_STR_SIZE];
static gchar file_sha1[HASH_STR_SIZE];
static char *hash_buf = NULL;
@@ -1024,11 +1023,6 @@ print_stats_table(const gchar *filename, capture_info *cf_info)
printf("%s", file_sha256);
putquote();
- putsep();
- putquote();
- printf("%s", file_rmd160);
- putquote();
-
putsep();
putquote();
printf("%s", file_sha1);
@@ -1168,7 +1162,6 @@ calculate_hashes(const char *filename)
size_t hash_bytes;
(void) g_strlcpy(file_sha256, "<unknown>", HASH_STR_SIZE);
- (void) g_strlcpy(file_rmd160, "<unknown>", HASH_STR_SIZE);
(void) g_strlcpy(file_sha1, "<unknown>", HASH_STR_SIZE);
if (cap_file_hashes) {
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp
index 9e5b86a7fd..c77056818c 100644
--- a/ui/qt/capture_file_properties_dialog.cpp
+++ b/ui/qt/capture_file_properties_dialog.cpp
@@ -175,11 +175,6 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
<< table_data_tmpl.arg(summary.file_sha256)
<< table_row_end;
- out << table_row_begin
- << table_vheader_tmpl.arg(tr("Hash (RIPEMD160)"))
- << table_data_tmpl.arg(summary.file_rmd160)
- << table_row_end;
-
out << table_row_begin
<< table_vheader_tmpl.arg(tr("Hash (SHA1)"))
<< table_data_tmpl.arg(summary.file_sha1)
diff --git a/ui/summary.c b/ui/summary.c
index 127698fd5c..58c7cd68a4 100644
--- a/ui/summary.c
+++ b/ui/summary.c
@@ -21,7 +21,6 @@
// Strongest to weakest
#define HASH_SIZE_SHA256 32
-#define HASH_SIZE_RMD160 20
#define HASH_SIZE_SHA1 20
#define HASH_BUF_SIZE (1024 * 1024)
@@ -213,12 +212,10 @@ summary_fill_in(capture_file *cf, summary_tally *st)
g_free(idb_info);
(void) g_strlcpy(st->file_sha256, "<unknown>", HASH_STR_SIZE);
- (void) g_strlcpy(st->file_rmd160, "<unknown>", HASH_STR_SIZE);
(void) g_strlcpy(st->file_sha1, "<unknown>", HASH_STR_SIZE);
gcry_md_open(&hd, GCRY_MD_SHA256, 0);
if (hd) {
- gcry_md_enable(hd, GCRY_MD_RMD160);
gcry_md_enable(hd, GCRY_MD_SHA1);
}
hash_buf = (char *)g_malloc(HASH_BUF_SIZE);
@@ -230,7 +227,6 @@ summary_fill_in(capture_file *cf, summary_tally *st)
}
gcry_md_final(hd);
hash_to_str(gcry_md_read(hd, GCRY_MD_SHA256), HASH_SIZE_SHA256, st->file_sha256);
- hash_to_str(gcry_md_read(hd, GCRY_MD_RMD160), HASH_SIZE_RMD160, st->file_rmd160);
hash_to_str(gcry_md_read(hd, GCRY_MD_SHA1), HASH_SIZE_SHA1, st->file_sha1);
}
if (fh) fclose(fh);
diff --git a/ui/summary.h b/ui/summary.h
index 9063b99b77..95a51a38c0 100644
--- a/ui/summary.h
+++ b/ui/summary.h
@@ -56,7 +56,6 @@ typedef struct _summary_tally {
const char *filename; /**< path of capture file */
gint64 file_length; /**< file length in bytes */
gchar file_sha256[HASH_STR_SIZE]; /**< SHA256 hash of capture file */
- gchar file_rmd160[HASH_STR_SIZE]; /**< RIPEMD160 hash of capture file */
gchar file_sha1[HASH_STR_SIZE]; /**< SHA1 hash of capture file */
int file_type; /**< wiretap file type */
wtap_compression_type compression_type; /**< compression type of file, or uncompressed */

View File

@ -1,74 +0,0 @@
From 2d55e5672b07a8a102024e0af66e821bba51213b Mon Sep 17 00:00:00 2001
From: Gerald Combs <gerald@wireshark.org>
Date: Sun, 27 Aug 2023 14:47:52 -0700
Subject: [PATCH] Qt: Fix ManageInterfacesDialog cleanup
Handle our ManageInterfacesDialog cleanup tasks inside our destructor.
If we try to handle them in on_buttonBox_accepted we run into a race
condition with WA_DeleteOnClose.
Fixes #19287
---
ui/qt/manage_interfaces_dialog.cpp | 25 ++++++++++++-------------
ui/qt/manage_interfaces_dialog.h | 2 --
2 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp
index cb9da8697b5..a8529e265a9 100644
--- a/ui/qt/manage_interfaces_dialog.cpp
+++ b/ui/qt/manage_interfaces_dialog.cpp
@@ -209,6 +209,18 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) :
ManageInterfacesDialog::~ManageInterfacesDialog()
{
+ if (result() == QDialog::Accepted) {
+#ifdef HAVE_LIBPCAP
+ sourceModel->save();
+#endif
+#ifdef HAVE_PCAP_REMOTE
+ remoteAccepted();
+#endif
+ prefs_main_write();
+ mainApp->refreshLocalInterfaces();
+ emit ifsChanged();
+ }
+
delete ui;
}
@@ -252,19 +264,6 @@ void ManageInterfacesDialog::updateWidgets()
ui->hintLabel->setText(hint);
}
-void ManageInterfacesDialog::on_buttonBox_accepted()
-{
-#ifdef HAVE_LIBPCAP
- sourceModel->save();
-#endif
-#ifdef HAVE_PCAP_REMOTE
- remoteAccepted();
-#endif
- prefs_main_write();
- mainApp->refreshLocalInterfaces();
- emit ifsChanged();
-}
-
#ifdef HAVE_LIBPCAP
void ManageInterfacesDialog::on_addPipe_clicked()
{
diff --git a/ui/qt/manage_interfaces_dialog.h b/ui/qt/manage_interfaces_dialog.h
index 80b78afbe7a..79e9d0d9bfa 100644
--- a/ui/qt/manage_interfaces_dialog.h
+++ b/ui/qt/manage_interfaces_dialog.h
@@ -59,8 +59,6 @@ signals:
private slots:
void updateWidgets();
- void on_buttonBox_accepted();
-
#ifdef HAVE_LIBPCAP
void on_addPipe_clicked();
void on_delPipe_clicked();
--
GitLab

View File

@ -1,12 +1,12 @@
%undefine __cmake_in_source_build
%global with_lua 1
%global with_maxminddb 1
%global plugins_version 4.0
%global plugins_version 4.2
Summary: Network traffic analyzer
Name: wireshark
Version: 4.0.8
Release: 3%{?dist}
Version: 4.2.2
Release: 1%{?dist}
Epoch: 1
License: BSD-1-Clause AND BSD-2-Clause AND BSD-3-Clause AND MIT AND GPL-2.0-or-later AND LGPL-2.0-or-later AND Zlib AND ISC AND (BSD-3-Clause OR GPL-2.0-only) AND (GPL-2.0-or-later AND Zlib)
Url: http://www.wireshark.org/
@ -27,10 +27,6 @@ Patch5: wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch
# Fedora-specific
Patch6: wireshark-0006-Move-tmp-to-var-tmp.patch
Patch7: wireshark-0007-cmakelists.patch
Patch8: wireshark-0008-glib2-g_strdup-build.patch
Patch9: wireshark-0009-fix-asn2wrs-cmake.patch
Patch10: wireshark-0010-ripemd-fips-core-dump.patch
Patch11: wireshark-0011-manage-interfaces-crash.patch
#install tshark together with wireshark GUI
Requires: %{name}-cli = %{epoch}:%{version}-%{release}
@ -82,6 +78,7 @@ BuildRequires: compat-lua-devel
Buildrequires: git-core
Buildrequires: python3-devel
Buildrequires: cmake
Buildrequires: speexdsp-devel
#needed for sdjournal external capture interface
BuildRequires: systemd-devel
BuildRequires: libnghttp2-devel
@ -235,8 +232,6 @@ fi
%{_libdir}/wireshark/extcap/sdjournal
%{_libdir}/wireshark/extcap/dpauxmon
%{_libdir}/wireshark/extcap/androiddump
%dir %{_libdir}/wireshark/cmake
%{_libdir}/wireshark/cmake/*.cmake
#the version wireshark uses to store plugins is only x.y, not .z
%dir %{_libdir}/wireshark/plugins/%{plugins_version}
%dir %{_libdir}/wireshark/plugins/%{plugins_version}/epan
@ -253,7 +248,6 @@ fi
%{_mandir}/man1/dumpcap.*
%{_mandir}/man4/wireshark-filter.*
%{_mandir}/man1/rawshark.*
%{_mandir}/man1/dftest.*
%{_mandir}/man1/randpkt.*
%{_mandir}/man1/reordercap.*
%{_mandir}/man1/sshdump.*
@ -266,7 +260,10 @@ fi
%{_mandir}/man1/dpauxmon.*
%{_mandir}/man1/sdjournal.*
%{_mandir}/man1/etwdump.*
%{_mandir}/man1/falcodump.*
%{_mandir}/man4/extcap.*
%{_datadir}/doc/wireshark/*
%if %{with_maxminddb} && 0%{?fedora}
%{_mandir}/man1/mmdbresolve.*
%endif
@ -278,9 +275,11 @@ fi
%doc doc/README.* ChangeLog
%{_includedir}/wireshark
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/%{name}.pc
%changelog
* Thu Feb 01 2024 Michal Ruprich <mruprich@redhat.com> - 1:4.2.2-1
- New version 4.2.2
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.0.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild