Commit Graph

84946 Commits

Author SHA1 Message Date
Tomasz Moń d0a9de2af1
capture: Stop extcaps before dumpcap
Send SIGTERM on UNIX systems to all extcap processes when user requests
capture stop. Wait up to 30 seconds for extcaps to finish. If extcaps do
not finish in time, send SIGKILL to remaining extcaps.

Do not call TerminateProcess() on Windows in the same place where UNIX
SIGTERM is sent. Instead schedule extcap termination timeout to happen
as soon as control returns back to the event loop.

There is no universally agreed replacement for SIGTERM on Windows, so
just keep things simple (forcefully terminate like always) until we
have agreed on something.
2022-08-13 20:23:51 +02:00
Pascal Quantin 8291dc23f3 RRC: upgrade dissector to v17.1.0 2022-08-13 17:35:21 +00:00
Gerald Combs bc10ddd7ba Docbook: Add a comment about the "reproducible" attribute. 2022-08-13 17:16:51 +00:00
Michael Tuexen a033dc7dc6 TCP: cleanup ECN related flags
The ECN-Echo flag is abbreviated in RFC 3168 using ECE, not ECN.
In addition, when displaying the flags, no abbreviations are
used. Therefore, do the same for the CWR flag.
2022-08-13 11:08:55 +00:00
John Thacker b5cea67768 Qt: Expert Info: Return TAP_PACKET_REDRAW if any ei is added
Any time an expert info is added to the Expert Info tap, the
Expert Info GUI tap listener needs to set TAP_PACKET_REDRAW.

draw_tap_listeners(FALSE) is called from MainApplication::updateTaps()
on a timer (controlled by a preference, defaulting to 3 seconds),
and that clears the Expert Info tap's need_redraw flag. The larger
a capture and the more expert infos, the more likely that the timer
can trigger while epan_dissect_run_with_taps() is still generating
more EI entries, but has already generated EIs of all severities
that are present in the capture. This prevents the expertInfoTreeView
from being redrawn at the end when the captureEvent is finished
retapping the packets.

Fix #18232. Fix #16591.
2022-08-13 10:55:32 +00:00
Pascal Quantin d982338177 NGAP: upgrade dissector to v17.1.1 2022-08-12 19:15:16 +00:00
Pascal Quantin cf17011c53 S1AP: add support for NTN NB-IoT TACs 2022-08-12 20:47:41 +02:00
Joakim Karlsson abe78a4109 sshdump: may be used uninitialized in this function [-Wmaybe-uninitialized] 2022-08-12 18:25:56 +00:00
Martin Mathieson 1337db5a18 check_typed_item_calls.py: check for consecutive calls to same item 2022-08-12 16:20:35 +00:00
Pascal Quantin 7d1f5939ae X2AP: upgrade dissector to v17.1.0 2022-08-12 16:44:14 +02:00
Pascal Quantin a9ea071b83 S1AP: upgrade dissector to v17.1.0 2022-08-12 15:23:48 +02:00
Joakim Karlsson 387a769003 PCAPNG: make dissect_block public for custom dissectors 2022-08-12 14:09:45 +02:00
Tomasz Moń 0bca2419d6
extcap: Do not drain stderr on process exit
Extcap child watch callback assumed that the stderr pipe is broken.
However the stdout and stderr pipes are not necessarily broken if the
child process spawned new processes that inherited standard handles.

Do not drain stderr in busy loop to prevent UI freeze. Stop capture
session only when all extcap watches are removed. Remove stdout and
stderr watches on capture stop timer (30 seconds) expiration, even if
the pipes are not broken.

Do not rely only on 0 bytes read to cease reading stdout and stderr.
Stop reading if the status is anything else than G_IO_STATUS_NORMAL
(especially it can be G_IO_STATUS_EOF).
2022-08-12 06:50:09 +02:00
Gerald Combs 25bb87a781 GitLab CI: BUILD_logwolf → BUILD_logray. 2022-08-11 17:56:28 -07:00
Vadim Yanitskiy 05f59f0045 GSM A RR: dissect random bit stream in SI6 Rest Octets
Since version 10.2.0 (2011-03) of 3GPP TS 44.018, unused octets of the
SI6 Rest Octets IE (see 10.5.2.35a) may optionally contain random bits
instead of the standard repeating sequence of '00101011'.

This is a counter-measure making the known-plaintext attack on encrypted
channels slower (and thus harder).  For more details, see GP-110384 [1].

[1] http://portal.3gpp.org/ngppapp/DownloadTDoc.aspx?contributionUid=GP-110384

Without this patch Wireshark would warn about an unknown or potentially
malformed PDU if the network is using random padding bits:

  SI 6 Rest Octets
      L... .... = PCH and NCH Info: Not Present
      .L.. .... = VBS/VGCS options: Not Present
      ..L. .... = DTM: Not Supported in Serving cell
      ...L .... = Band Indicator: 1800
      .... L... = GPRS MS PWR MAX CCCH: Not Present
      .... .L.. = MBMS Procedures: Not supported
      .... ..L. = Additions in Rel-7: Not Present
      Padding Bits: Unknown extension detected or malformed PDU (Not decoded)

With this patch, value of the random bit stream indicator is used to
determine presence of random bit stream (padding):

  SI 6 Rest Octets
      L... .... = PCH and NCH Info: Not Present
      .L.. .... = VBS/VGCS options: Not Present
      ..L. .... = DTM: Not Supported in Serving cell
      ...L .... = Band Indicator: 1800
      .... L... = GPRS MS PWR MAX CCCH: Not Present
      .... .L.. = MBMS Procedures: Not supported
      .... ..L. = Additions in Rel-7: Not Present
      .... ...H = Random Bit Stream: Present
      Padding Bits: random bit stream
2022-08-11 19:18:17 +00:00
Vadim Yanitskiy dbf18e1de1 GSM BSSMAP LE: cosmetic: fix inconsistent spacing in bssmap_le_elem_fcn[] 2022-08-12 01:14:26 +07:00
Anders Broman cc57beb304 PFCP: UP Function feature bit QUASF typo, take 2. 2022-08-11 15:16:42 +00:00
Daniël van Eeden 913a96a2d3 mysql: Correct query attribute handling
This fixes dissection of queries with new clients with query attribute
support to servers that don't support this.
2022-08-11 14:08:55 +00:00
Anders Broman 903a5a74ee NAS-5GS: Update comment in Route selection descriptor content. 2022-08-11 12:36:26 +00:00
John Thacker 414dab7396 L2TP: Add generated PW type field to data packets, etc.
Add a generated item showing the pseudowire type for the session
to L2TP data packets.
Use ccid instead of tunnel id in the info column for L2TPv3
Consistently use hex for SIDs and CCIDs in L2TPv3 instead of a mix
of hex and decimal.
Remove some unnecessary whitespace in info column
Include the L2-Specific Sublayer length in the L2TP length
Put the L2-Specific Sublayer in the L2TP tree instead of the root tree

Along with previous commits, fix #16565.
2022-08-11 07:16:45 -04:00
Pascal Quantin 32bce6c8d6 TLS: put DIG_NA macro in last position 2022-08-11 08:52:29 +00:00
zhangzhilei 9da3c833a4 TLS: sync ciphers with ENC_ macro
we should add SM1 and SM4 to ciphers because there are
ENC_SM1 and ENC_SM4 defined in packet-tls-utils.h
2022-08-11 08:27:47 +00:00
Anders Broman e5db541526 PFCP: UP Function feature bit QUASF typo. 2022-08-11 08:11:16 +00:00
zhangzhilei 6cd2258c55 TLS: sync digests with DIG macro
since we define DIG_MD5(0x40) to DIG_SM3(0x45) in
epan/dissectors/packet-tls-utils.h
and in ssl_cipher_suite_dig,
we use cs->dig - DIG_MD5 to retrive from digests,
so we should add SM3 to digests
2022-08-11 07:54:24 +00:00
Daniël van Eeden 7160d9e0f0 mysql: Fix capability check in login packet
The flag for ZSTD compression is part of the extended capabilities, not
the basic capabilities.
2022-08-11 07:37:56 +00:00
John Thacker a81a7876f1 L2TP: Account for cookie length in protocol length, etc.
A few of the minor usability improvements mentioned in #16565.
Account for the cookie length in the protocol length, and
simplify some of the accounting.
Rename the "Packet Type" item as "Flags" because it contains
several different boolean flags. Add it as a bitmask instead
of with a separate tree, which provides a better summary.
Remove the l2tp.session_id field that duplicated l2tp.sid
(but only in L2TP over IP data messages)
2022-08-11 07:11:36 +00:00
zhangzhilei 1bdf7427b6 TLS: fix wrong debug text
fix wrong debug text
2022-08-11 06:55:05 +00:00
DarienSpencer65 61e1da8e86 UMTS RLC: Support no-op encryption (UEA0) 2022-08-11 06:43:37 +00:00
John Thacker ee6519bca6 L2TP: Use the IANA assigned PW types for Decode As
Instead of registering subdissectors to arbitrary Wireshark
assigned numbers, register them to the actual pseudowire type
number assigned by IANA and present in the Pseudowire Type AVP.
Half of the previously registered types were never used, because
the dissector table could not be called with their Wireshark
internal number.

This makes it easier to add dissectors to support currently
unsupported but assigned types, and also makes it more intuitive
to use Decode As when the PW Type AVP is not present. Previously,
the dissector for the "default" type of CHDLC had to be changed to
a different subdissector.
2022-08-10 21:23:38 -04:00
Jaap Keuter 34ab3f308a sshdump: add option to select dumpcap as remote capture command 2022-08-10 17:26:49 +00:00
Pascal Quantin af558f672b NR RRC: upgrade dissector to v17.1.0 2022-08-10 18:05:01 +02:00
John Thacker e51916b54c L2TP: Fix UDP conversation handling.
RFCs 2661 and 3931 say that L2TPv2 and L2TPv3 use a TFTP-like method
of selecting ports. The initiator picks a source port (which may or
may not be 1701, the IANA assigned L2TP port), and sends a message to
1701; the recipient picks a free port (which may or may not be 1701)
and replies to the initiator's chosen port and address, and the
conversation from then on uses the chosen ports.

In practice, due to NAT, firewalls, etc., most implementations just
use a symmetric predetermined L2TP port. To support both methods
we use one-sided conversations with one port omitted. Fix the lookup
of the reverse conversation. Part of #16565.
2022-08-10 12:35:50 +00:00
Pascal Quantin f1140dbc9c LPP: upgrade dissector to v17.1.0 2022-08-10 14:16:18 +02:00
Pascal Quantin dc03586983 LTE RRC: upgrade dissector to v17.1.0 2022-08-10 12:58:20 +02:00
Pascal Quantin 100fe4e94e NAS 5GS: fix decoding of T3324 IE
T3324 IE is GPRS timer 3 type.
2022-08-10 09:46:31 +02:00
John Thacker 13df9b0b64 HTTP: Speed up chunked Transfer-Encoding on TCP
HTTP/1.1 chunked Transfer-Encoding doesn't have a overall length,
but requires scanning through variable length chunks to find the
end. If we determine that additional segments are needed, and
we have a sequence number (or other identifier) for the message,
store the position of the last chunk size found.

Use this to start scanning at that same offset when the next
segment arrives, reducing the algorithm for determining if
when we have the complete chunked message from O(N^2) to O(N),
which can be significant on captures with many chunks.

This does most of #14382, reducing the length of time to process
a file with 2 pass tshark from over 8.5 secs to under 3 seconds
on my machine. There is still some O(N^2) contribution from the
reassembly code itself with many small fragments (see #17311).

Other dissectors need some small changes to enable this for
HTTP over other transport layers. (TLS would be fairly easy and
is the other important case.)
2022-08-10 05:31:36 +00:00
John Thacker 5e04463282 L2TP: Store cookie length, session IDs, and PW type from Cisco AVPs
Store the cookie length, session IDs, and pseudowire type when
they are carried in Cisco vendor-specific AVPs in the same way
as done with the IETF AVPs. More of #16565.
2022-08-10 05:06:16 +00:00
Tomasz Moń 7316b16e1d
extcap: Read stdout and stderr during capture
Read extcap stdout/stderr data when available to prevent extcap hang on
stdout/stderr write. Discard stdout data as it was not used earlier.
Store up to 1024 bytes of stderr and display it to user after capture
stops.

Fixes #17827
2022-08-10 06:18:25 +02:00
Tomasz Moń ac4e1b86b8
wsutil: Use GIOChannel for standard pipes
Remove ws_read_string_from_pipe() as this function encourages bad design
and is no longer necessary. Extcap stderr is read only after the child
process has finished and thus the read will never block.

Close process information thread handle right away as we don't use it.
Remove unused ws_pipe_t member variables.
2022-08-10 06:18:25 +02: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
John Thacker 86c6509cf3 L2TP: Don't report Malformed Packet on ZLB messages
Don't have things that substantively affect dissection depend
on whether the tree is present or not. (It's not really necessary
to do all these checks anyway since items are faked.)

Prevents adding "[Malformed Packet]" to the Info column for all
Zero Length Body messages. One of the things mentioned in
issue #16565 (that patch was lost with Gerrit.)
2022-08-09 20:43:52 -04:00
John Thacker 787ecb7f1d file-jpeg: Reduce expert info to PI_PROTOCOL for Exif
Change the expert info for Exif files that have Exif instead
of JFIF in their first identifier fields from a PI_MALFORMED
to PI_PROTOCOL. It's not the correct protocol spec, but it's
common in Exif files and it doesn't make the dissector give up,
so PI_PROTOCOL is more appropriate.
2022-08-09 19:37:03 -04:00
John Thacker 678fba2bc9 TURN: Don't report bogus PDU lengths
Since STUN and TURN (and DLTS, RTCP) are multiplexed togther,
using the non-heuristic TURN dissector with Decode As is not
usually the correct choice. However, if we're doing that, and
the packet doesn't look like a TURN packet, don't give a bogus
PDU length to the TCP dissector but instead take until the end
of the packet. Fix #16756
2022-08-09 23:03:40 +00:00
David Perry 8528f96ea4 Name `proto_nfs_unknown` as "Unknown NFS" 2022-08-09 19:42:55 +00:00
David Perry 43d499ca45 Use `register_dissector()` for more protocols 2022-08-09 18:50:08 +00:00
John Thacker 33a34aeec1 stun: Add some comments
Update the attributes to include four Google undocumented attributes
in the IANA registry. Add a comment about the Unassigned value that
was Data Indication in the TURN draft, and note that MS-TURN still
mentions it and some captures use it.
2022-08-09 07:42:05 -04:00
Chuck Craft ebb68e0b23 KINK: change default to IANA port 910 (RFC 4430)
Looks like the dissector was added with a draft of protocol before
the port was assigned - "KINK uses UDP on port [XXX -- TBA by IANA]"
2022-08-09 08:37:47 +00:00
Joakim Karlsson 318b969d1d GRE: forward GRE key to encapsulated data 2022-08-09 09:52:09 +02:00
John Thacker 203cd2cba9 prefs: More cleanup, auto prefs
Remove callback function from pref registrations for dissectors that
don't need a callback. In other dissectors, move registration that
only needs to be done once inside the check for initialization,
avoiding some console messages when preferences are changed
("Duplicate dissectors (anonymous) and (anonymous) for protocol...")
and the like.

Add a couple auto preferences for dissectors missed in previous waves.

Ping #14319
2022-08-09 06:21:05 +00:00
John Thacker 862803de5c HTTP2: Send headers to the follow tap after decompression
Field blocks (carried in HEADERS, PUSH_PROMISE, and CONTINUATION
frames) are compressed by HPACK. Send them to the follow tap only
after decompression. Update the tests to match the new output.

Ping #18239 (There's still the case of gzip and brotli compressed
DATA frames to handle).
2022-08-08 23:50:20 +00:00