Commit Graph

81816 Commits

Author SHA1 Message Date
Guy Harris 510c088ce6 ngsniffer: fix a routine name.
That routine now only processes frame records; call it
process_frame_record().
2021-08-30 20:45:52 +00:00
Gerald Combs b300c063c2 Add a code of conduct.
After reviewing several codes of conduct, the KDE CoC[1][2] seems to
match the goals and personality of our community the best. Adapt it to
suit our needs. Name the file CODE_OF_CONDUCT.adoc, which seems to be
the most common base name. Note that it must be kept in sync with
https://www.wireshark.org/code-of-conduct.html.

[1]https://kde.org/code-of-conduct/
[2]https://invent.kde.org/websites/kde-org/-/blob/master/content/code-of-conduct.md
2021-08-30 20:29:19 +00:00
Guy Harris dcfa3ec835 ngsniffer: clean up the read process.
Have a routine to read the Sniffer record header, and call that in
ngsniffer_read() and ngsniffer_seek_read().  Only call
ngsniffer_process_record() for frame records that we understand, so that
we only allocate a block for those rather than for records we don't
understand or for EOF records, potentially leaking them.
2021-08-30 12:47:38 -07:00
Dr. Lars Völker 2c543f999b DoIP/ISO15765/UDS: Passing addresses to UDS to refine lookup
This patch adds support to DoIP and ISO15765 to pass the diagnostic
address or addresses to UDS. UDS takes the relevant address into account
for the data identifier and routine identifier name resolution.
2021-08-30 16:10:55 +00:00
David Perry d3d4e4b135 Show error for `-X lua_script` if no Lua support
Wireshark/tshark may be built without Lua support. This patch adds an
error message if the user specifies the `-X lua_script` command-line
argument to a program built without Lua support, so the user is not left
wondering why their script isn't working.
2021-08-30 08:01:05 -04:00
Stig Bjørlykke 3efb3cab62 gsm_sim: Fix MANAGE CHANNEL
Use correct offset for P1 and P2 when showing channel operation
and channel number.

According to TS 102 221 V14.2.0 the Open channel operation is using
P2 for channel, and let UICC assign when this is 0. Show P3 as Le.
Make P3 optional because it's not present in at least Close channel
operation.

Change text in Info column to avoid "Channel Channel: x".
2021-08-30 08:49:38 +00:00
Joey Salazar 28dbab369d git: Add test cases
Add git dissection test cases to existing testing suite for: finding git
packets, finding the Git Protocol version, finding the right amount of
Flush and Delimiter packets, not finding Malformed packets.

Part of #17093
2021-08-30 06:34:52 +00:00
Tobias Mueller 853d55b871 pcapng: declare offset to be volatile to fix build error on aarch64
This attempts to fix an error encountered when building Wireshark on aarch64:

[254/2488] Building C object epan/dissectors/CMakeFiles/dissectors.dir/file-pcapng.c.o
FAILED: epan/dissectors/CMakeFiles/dissectors.dir/file-pcapng.c.o
/usr/bin/cc -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DWS_BUILD_DLL -I. -isystem /usr/include/glib-2.0 -isystem /usr/lib/aarch64-linux-gnu/glib-2.0/include -isystem /usr/include/libxml2 -isystem epan/dissectors -isystem epan -fvisibility=hidden  -fexcess-precision=fast -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wredundant-decls -Wframe-larger-than=32768 -fdiagnostics-color=always -Wunused-const-variable -Wshadow -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-init -Werror=implicit -Wno-pointer-sign -std=gnu99 -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fmacro-prefix-map=/run/build/wireshark/= -fmacro-prefix-map=/run/build/wireshark/= -O2 -g -DNDEBUG -fPIC -Werror -MD -MT epan/dissectors/CMakeFiles/dissectors.dir/file-pcapng.c.o -MF epan/dissectors/CMakeFiles/dissectors.dir/file-pcapng.c.o.d -o epan/dissectors/CMakeFiles/dissectors.dir/file-pcapng.c.o -c epan/dissectors/file-pcapng.c
epan/dissectors/file-pcapng.c: In function ‘dissect_spb_data’:
epan/dissectors/file-pcapng.c:1599:9: error: variable ‘offset’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
 1599 |     int offset = 0;
      |         ^~~~~~
epan/dissectors/file-pcapng.c: In function ‘dissect_epb_data’:
epan/dissectors/file-pcapng.c:1791:9: error: variable ‘offset’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
 1791 |     int offset = 0;
      |         ^~~~~~
epan/dissectors/file-pcapng.c: In function ‘dissect_pb_data’:
epan/dissectors/file-pcapng.c:1541:9: error: variable ‘offset’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
 1541 |     int offset = 0;
      |         ^~~~~~
cc1: all warnings being treated as errors
[255/2488] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-autosar-nm.c.o
[256/2488] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-bblog.c.o

Fixes: https://gitlab.com/wireshark/wireshark/-/issues/17554
2021-08-30 05:49:52 +00:00
Jiří Engelthaler 40aebad079 IEC104: Added Counter integrrogation command qualifier dissection 2021-08-30 04:51:11 +00:00
Guy Harris 3cb6403a4c wiretap: always allocate a block for a record.
Without that, you could add a comment to a record in a file format the
reading code for which doesn't allocate blocks, but the comment doesn't
get saved, as there's no block in which to save the comment option.

This simplifies some code paths, as we're either using the record's
modified block or we're using the block as read from the file, there's
no third possibility.

If we attempt to read a record, and we get an error, and a block was
allocated for the record, unreference it, so the individual file readers
don't have to worry about it.
2021-08-29 19:12:13 -07:00
Chuck Craft eb2037fda4 NSIS: add ntar to AdditionalTasksPage screen 2021-08-29 21:02:09 +00:00
Berk Akinci 0ba0d4e779 USB HID: Fix Usage Maximum typo
Fix typo preventing 'Usage Maximum' values from being parsed.
Values were were reported as 'Usage:'.
2021-08-29 20:02:25 +02:00
Berk Akinci 64a76cca7f USB HID: Update to match HID Usage Tables version 1.22
Add camera control page (0x90). Usages are up to date with HID Usage
Tables for USB version 1.22.
2021-08-29 20:02:16 +02:00
Martin Mathieson eb2078e89e Thrift: make some functions static. 2021-08-29 11:59:38 +01:00
Jörg Mayer c8656a2dcb New dissector for EXOS internal capture extra header 2021-08-29 14:11:34 +00:00
Joakim Andersson ed9e958a2e nordic_ble: Update text for channel to include index
Update channel to include index to clear up possible confusion if this
is RF channel, or channel index.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-29 13:37:23 +00:00
Joakim Andersson eda513d972 btle: Update text for channel to include index
Update channel to include index to clear up possible confusion if this
is RF channel, or channel index.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-29 13:37:23 +00:00
Allan Møller Madsen 23a3daefbf BTHCI: Add new Bluetooth v5.3 HCI commands/event dissection
New HCI commands/event dissected:
- LE Set Data Related Changes Command
- LE Set Default Subrate Command
- LE Subrate Request Command
- LE Subrate Change Event

5.3 version number added, LE event mask, supported commands and
LE feature bitmaps updated.
2021-08-29 13:09:57 +00:00
Joakim Andersson 1f0251a82d nordic_ble: Mark failure to decrypt reason as CRC error over MIC error
A packet that has been received by the sniffer with CRC errors will not
decrypted properly by the sniffer. Mark the decrypt failure reason as
CRC error instead of MIC error.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-29 12:53:43 +00:00
Gerald Combs dc122d1404 [Automatic update for 2021-08-29]
Update manuf, services enterprise numbers, translations, and other items.
2021-08-29 11:54:22 +00:00
Evan Huus 7124525d24 epan: remove a few more uses of wmem_packet_scope 2021-08-29 11:38:25 +00:00
Chuck Craft eaa2cf0c21 Cmake: misplaced quote in epub asciidoctor_opts
Follow up to !3988
2021-08-29 11:21:54 +00:00
Tomasz Moń c2edb44a9a Qt: fix memory leaks found by Visual Leak Detector
Set PacketDiagram as parent of QGraphicsScene so the scene is destroyed
together with PacketDiagram.

Dynamically allocate WiresharkApplication and explicitly call its
destructor when no longer needed. This results in deletion of
FunnelAction objects created in register_menu_cb() and QAction objects
created in TapParameterDialog::registerDialog(). For some reason, when
breakpoint was set inside WiresharkApplication destructor it would not
get triggered on exit, and so the child objects would get reported as
memory leaks.

Delete main window and application only after epan_cleanup(). This makes
lua plugins actually call ops during cleanup (e.g. destroy_text_window)
and makes it possible to free the memory allocated in FunnelStatistics
constructor.
2021-08-29 08:50:57 +00:00
Guy Harris bce7cbf529 lapd: clean up variable names, remove unnecessary initialization.
Use "flags" for the OPT_PKT_FLAGS option value, as we do elsewhere.  Use
"lapd_flags" for the variable holding the LAPD flags.

We don't need to initialize flags, as we extract the OPT_PKT_FLAGS
option into it immediately after initializing it (if the attempt to get
that option fails, it's not set, but it's not used, either).
2021-08-29 08:34:46 +00:00
Tomasz Moń e9533a3f5d Qt: stop capture syntax worker thread on exit
Instead of creating endless loop and synchronizing using QWaitCondition,
execute the syntax worker check in its thread by emitting signal. The
syntax worker thread affinity is set to worker thread so the slots
handling takes place within the worker thread context.
2021-08-29 08:16:32 +00:00
Guy Harris dd8c23c83d pcapng: remove include of wtap_opttypes.h.
It's already included by wtap/wtap.h, which this file includes, and it
doesn't need to be included that early, so that #include isn't
necessary.
2021-08-29 01:00:02 -07:00
Guy Harris 07416c01dc peektagged: set rec->block right after rec->rec_type.
That's how it's done in other files, and the two are somewhat connected
(the record type and block type are somewhat correlated).
2021-08-29 00:33:22 -07:00
Guy Harris 5e2fb6c000 packet-frame: assorted cleanups.
Remove unnecessary initializations.

Rename the variable for the packet ID option to match the name of the
option (it's epb_packetid in the pcapng spec, with no underscore between
"packet" and "id").
2021-08-28 23:43:44 -07:00
Guy Harris 266d707dff pcapng: whitespace and other cleanups.
Remove some extra blank lines, add a blank line where it belongs, and
get rid of a stray #-only line.
2021-08-28 22:29:21 -07:00
Guy Harris 10be4d1611 pcapng: fix handling of byte-swapped sysdig event blocks.
We weren't setting wblock->rec->rec_header.syscall_header.nparams for
byte-swapped event blocks.
2021-08-28 16:00:41 -07:00
Jiří Engelthaler b428fa509d IEC104: Added Substituted / Not substituted dissection of CP56Time2a
Closing #17209
2021-08-28 12:39:08 +00:00
Developer Alexander 68893e415c capture file: remove redundant API ref_time_packets()
Redundant API ref_time_packets() gets removed.

cf_reftime_packets() gets a better dokumentation.
2021-08-28 07:53:51 +02:00
Guy Harris 9b132c2353 pcapng: fix output of comment and DNS server name options.
Copy to the buffer the string value, not the structure that contains it.
2021-08-27 18:14:02 -07:00
Gerald Combs 97b6610818 GitLab CI: Fix a command.
BSD stat doesn't support `--format`.
2021-08-27 15:47:40 -07:00
Martin Mathieson 70e26d691e Some spelling fixes. 2021-08-27 22:21:40 +00:00
Gerald Combs 916dac3316 GitLab CI: Print package sizes and hashes.
Print the sizes of our source, Windows, and macOS packages. Print the
hash of our macOS package.
2021-08-27 22:01:25 +00:00
Gerald Combs f51b018f87 Version: 3.5.0 → 3.5.1. 2021-08-27 21:40:12 +00:00
Guy Harris 5536ca319a wtap_opttypes: fix a typo. 2021-08-27 12:54:02 -07:00
Gerald Combs e7296d5208 Packaging: Try to fix git-export-release.sh.
Attempting to release 3.5.0 failed with

No local changes to save
Creating ./wireshark-3.5.0.tar.xz
fatal: not a valid object name: stash@{0}

Use CI_COMMIT_SHA for our export commit if it exists.
2021-08-27 11:13:45 -07:00
Gerald Combs b7ff41703e Build: 3.5.0.
[skip ci]
2021-08-27 10:17:38 -07:00
John Thacker f997f28898 AMQP: Fix dissection of PDUs split across TCP segments
AMQP calls a subdissector table before tcp_dissect_pdus() is used to
desegment PDUs (see commit 27c10ed72e),
so pinfo->can_desegment needs to be restored before it is decremented
a second time.  Fixes #14217.
2021-08-27 12:23:00 +00:00
Guy Harris 4b7bfe35c5 pcapng: process uint32 options like uint64 options.
Move the extraction of the option value from the option content from the
callers of pcapng_process_uint32_option() to
pcapng_process_uint32_option() itself.
2021-08-27 08:58:13 +00:00
John Thacker 0e3782831a SMB: Don't canonize filenames to ASCII for Export Objects
Windows can allow Unicode in filenames now, and export_object.c
has its own eo_massage_str function that the GUI and CLI already
call to create safe filenames when they are saved. There's no need
for an individual dissector like SMB to have its own (worse)
implementation of the same functionality, and to call it before
filenames are displayed. Fix #17530
2021-08-27 08:24:55 +00:00
Jeroen Sack 0ceaaad763 Isobus-VT: Fix description of auxiliary input status enable message
Show if message indicates that auxiliary input was enabled or disabled
2021-08-27 08:04:54 +00:00
Jeroen Sack 2468cfefe2 Isobus: Change email address
Used my work email previously, but have not been working for them for a long
time already.
2021-08-27 08:04:54 +00:00
Guy Harris a21972d6b9 pcapng: remove some old code left behind by the previous change. 2021-08-27 00:33:09 -07:00
Guy Harris 8acd0d1151 pcapng: export routines to do the option-section processing.
That way, add-on modules to handle block types not handled by the core
pcapng code can use pcap_process_options() to process a block's options
and can use the routines to handle the "standard" option value types to
handle particular options.

Also, allow both everything-is-little-endian and
everything-is-big-endian Custom Block types in pcap_process_options().
2021-08-27 06:48:47 +00:00
Triton Circonflexe d4de52690f Thrift: Complete handling of Binary & Compact protocols
- Make sure reassembly requests & errors are properly propagated from
  any point in the PDU, no matter how many sub-structure levels.
- Handle the sub-dissection methods as well:
  - Ensure the sub-dissection methods handle errors from previous calls.
  - Reduce the error handling needed in sub-dissector implementations.
  - Add missing sub-dissection methods for list, set, and map.
  - Add the handling of sub-structure.
- Handle Compact protocol in addition to the existing binary protocol.
  - Include and improve MR !3171
  - Handle reassembly the same way as for binary protocol.
  - Handle sub-dissection with the same functions.
    => Sub-dissectors only depend on .thrift files.

Additional changes:
- Use of constants instead of hard-coded values.
- Removed U64 support (never supported by thrift code generator, only
  referenced in the C++ thrift library header but not supported in reality.
- Removed references to UTF-8 and UTF-16 string for the same reason.
- Replaced references to UTF-7 string with just string (same reason).
- Replaced references to byte with i8 as the documentation explicitly
  states that byte is a compatibility name.

Documentation reference:
- https://thrift.apache.org/developers
- https://thrift.apache.org/docs/idl.html
- https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md
- https://erikvanoosten.github.io/thrift-missing-specification/
- https://diwakergupta.github.io/thrift-missing-guide/

Closes #16244

Additional changes:
- Add authors and improve consistency
- Fix typo and clarify documentation
2021-08-27 06:04:17 +00:00
Michael Tuexen b17f354304 Add initial support for BBLog files 2021-08-27 04:48:21 +02:00
Gerald Combs 8c4543373a CMake: Use "'" instead of "’" in our guide filenames.
Use an apostrophe instead of RIGHT SINGLE QUOTATION MARK in our PDF and
EPUB filenames. Some programs (notably Okular) can't open filenames with
extended characters, at least on Windows.
2021-08-27 01:18:13 +00:00