Commit Graph

79852 Commits

Author SHA1 Message Date
Dario Lombardo f7b0f9b2d4 tshark: prevent multiple -T.
Subsequent use of -T option infere to each other
creating strange option combinations. Multiple -T
are not supported, then prevent them.

Fix: #17139.
2021-01-21 07:57:37 +00:00
Joakim Andersson 8da6d6d1cc bluetooth: Add event counter and event counter valid to context
Add event counter and event counter valid variables to the btle context.
This information has to come from the capture context, and the information
is useful to provide context information around LL control procedures with
instant.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-01-21 07:22:47 +00:00
Guy Harris df53c21cab Move some variables inside the block where they're used.
They're not used outside a block, so move them inside the block.  Also,
they're set before they're used, so don't initialize them when they're
declared.

This should squelch some unreadVariable warnings from cppcheck.
2021-01-20 19:09:51 -08:00
Dr. Lars Völker 150d138a0d dot11crypt: Fixing bug that breaks build on Windows
Fixes: #17167
2021-01-20 22:15:32 +00:00
Guy Harris f9fc064255 Cast __LINE__ to unsigned int and print it with %u.
No version of ISO C I can find (from C90 to C18) says anything more
about __LINE__ than that it's an "integer constant", with no indication
whether it's signed or unsigned (or whether it's int or long or long
long), so we just cast it to "unsigned int" and print it with %u, as it
would make Absolutely No Sense if it were negative.

This should squelch some invalidPrintfArgType_uint warnings from
cppcheck.
2021-01-20 13:48:08 -08:00
Guy Harris d78d50d5a1 Move some variables inside the block where they're used.
They're not used outside a block, so move them inside the block.  Also,
they're set before they're used, so don't initialize them when they're
declared.

This should squelch some unreadVariable warnings from cppcheck.
2021-01-20 12:45:46 -08:00
Mikael Kanstrup 69aa20669c dot11decrypt: Refactor Dot11DecryptRsna4WHandshake function
The Dot11DecryptRsna4WHandshake has grown unreasonably large. Refactor
the function and break out some functionality into smaller utility
functions to make it easier to understand.
2021-01-20 16:10:12 +00:00
Mikael Kanstrup fbb9056d20 dot11decrypt: Add partial FT-EAP decryption support
Add partial support for decrypting captures with connections
established using FT-EAP. To support deriving keys for FT-EAP
the MSK is needed. This change adds MSK as a valid IEEE 802.11
protocol input key type preference as well.

Note that FT-EAP support comes with the following imitations:

- Keys can only be derived from the FT 4-way handshake messages.
- Roaming is not supported.
2021-01-20 16:10:12 +00:00
Mikael Kanstrup 76932c250a ieee80211: Dissect FTE and MDE with flags and subtrees
To increase readability of IEs used with Fast BSS Transition
dissect FTE and MDE fields with flags and subtrees.

- FT element count is part of MIC control element.
- FT over DS is part of FT capability and Policy field.
- Resource Request Protocol Capability is part of FT
  capability and Policy field.
- Dissect FT subelements with a separate subtree.

Change-Id: Id9bea07234c3314991a75781c59321faa600a0f6
2021-01-20 16:10:12 +00:00
Mikael Kanstrup 2306cbddb9 dot11decrypt: Support decrypting FT initial mobility domain
Add partial support for decrypting captures with connections
established using FT BSS Transition (IEEE 802.11r).

FT BSS Transition decryption comes with the following limitations:

- Only FT-PSK is supported.
- Keys can only be derived from the FT 4-way handshake messages.
- Roaming is not supported.
2021-01-20 16:10:12 +00:00
Mikael Kanstrup 75e90aa4e9 dot11decrypt: Create utility PRF and KDF derive functions
Break out the PRF and KDF functionality from the PMK to PTK
derivation functions and make them separate utility functions
implemented as defined in the IEEE 802.11 standard.

This change is done in preparation for supporting additional
AKMS where the key derivation functions can be reused to derive
other type of keys.
2021-01-20 16:10:12 +00:00
Mikael Kanstrup 8f8e87e384 dot11decrypt: Indentation using whitespace in dot11decrypt_util
Change from tab to whitespace in dot11decrypt_util source and header
files. Add modelines.
2021-01-20 16:10:12 +00:00
Pascal Quantin f64eddfd01 NAS 5GS: fix display of IPv6 interface identifier
Do not use FT_IPV6 as an interface identifier could be wrongly identified
as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed
as such.
2021-01-20 14:41:12 +01:00
Pascal Quantin b794e4798a NAS EPS: fix display of IPv6 interface identifier
Do not use FT_IPV6 as an interface identifier could be wrongly identified
as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed
as such.
2021-01-20 14:39:09 +01:00
Alexis La Goutte 3aa64fe819 ieee80211: Update Public Action
From 802.11-2016.pdf (Table 9-307)
2021-01-20 11:40:16 +00:00
Alexis La Goutte 476d2e81ff ieee80211: Add Reduced Neighbor Report (201)
From 802.11-2016.pdf

Close: #17096
2021-01-20 11:23:49 +00:00
Martin Mathieson 3019bc4efc MAC-LTE: Make main disection function static 2021-01-20 10:56:18 +00:00
Alexis La Goutte acf713313e ieee80211: Fix Environnement
When it is not outdoor or indoor environnement (only display hex value)

Close #16910
2021-01-20 10:28:07 +00:00
Guy Harris 5c71955270 Move some variables inside the block where they're used.
They're not used outside a block, so move them inside the block.  Also,
they're set before they're used, so don't initialize them when they're
declared.

This should squelch some unreadVariable warnings from cppcheck.
2021-01-20 01:34:17 -08:00
Guy Harris 05b9e53777 Don't dereference a known-to-be-null pointer.
In dump_dfilter_macro_t(), if the dfilter_macro_t pointer is null, just
give up after printing the message that indicates that.

This should squelch several nullPointerRedundantCheck warnings from
cppcheck.
2021-01-20 01:07:18 -08:00
Guy Harris 28d89773fb Move some variables inside the block where they're used.
They're not used outside a block, so move them inside the block.  Also,
they're set before they're used, so don't initialize them when they're
declared.

This should squelch some unreadVariable warnings from cppcheck.

Fix indentation of a line of code while we're at it.
2021-01-20 00:44:31 -08:00
Guy Harris 97a168747f Move some variables inside the block where they're used.
They're not used outside a block, so move them inside the block.  Also,
they're set before they're used, so don't initialize them when they're
declared.

This should squelch some unreadVariable warnings from cppcheck.
2021-01-20 00:14:19 -08:00
Guy Harris 11b500ce1c Remove redundant assertion.
I guess we used to just have a g_assert() here to check that there was a
subdissector table to which to add the capture dissector, but we now
have a test for a null subdissector table pointer that attempts to
produce a more detailed and more useful error (and to fail only if we've
set the "crash on some otherwise-ignored errors" environment variable).

Remove the assertion, as we've already ensured that, at that point, the
subdissector table pointer is not null.

This should squelch a constArgument warning from cppcheck.
2021-01-19 23:40:31 -08:00
Guy Harris 138041b545 Squelch "Clarify calculation precedence" warning from cppcheck.
For

        A & B ? C : D

put "A & B" in parentheses, to clarify the precedence.
2021-01-19 23:12:03 -08:00
Guy Harris 887cacd12c Don't check whether eth_name_lookup() returned a null pointer.
It never returns a null pointer.

(At least some compilers support decorating function declarations with
indications that they never return a null pointer; hopefully at least
some of them attempt to validate that claim, and report at least a
warning, if not an error, if they can't.  We should look at decorating
functions in that fashion.)

This should squelch a nullPointerRedundantCheck warning from cppcheck.
2021-01-19 21:14:10 -08:00
Guy Harris 64f1d09ef3 Make various max packet sizes unsigned, and clean up from that.
Make some packet size variables unsigned.

Leave some others signed, because they're read with sscanf(), and
sscanf() handles string-to-unsigned conversions in the same crazy way
strtouX() routines do, wherein a leading sign is *not* an error.
Instead, cast them to unsigned after we make sure they're not negative.
2021-01-19 19:02:01 -08:00
Guy Harris 6db087ae4b No need to check for both "not null" and "is space".
The latter implies the former.

Squelches a cppcheck redundantCondition warning.
2021-01-19 17:06:45 -08:00
Guy Harris 793333d039 Make some loop indices private to their loops.
This also squelches a cppcheck unreadVariable warning.
2021-01-19 16:42:39 -08:00
Guy Harris c6d1031328 Squelch duplicateCondition warning from cppcheck.
Put three statements, all executed iff cap_snaplen is true, into a
single if statement.
2021-01-19 16:16:00 -08:00
Guy Harris 6b85987e4a Squelch "Clarify calculation precedence" warning from cppcheck.
For

	A & B ? C : D

put "A & B" in parentheses, to clarify the precedence.
2021-01-19 15:46:10 -08:00
po307ax f92206ab51 Add dissector for Asterix Category 240 v1.3. 2021-01-19 13:42:23 +00:00
Guy Harris 165792fb31 dup() can fail; check whether it does.
If, for example, you run out of file descriptors, dup() can fail, and
ws_dup() is a wrapper around it on UN*X.  Don't just pass the result of
ws_dup() to ws_fdopen(); instead, save its result, check against -1 and,
if it's -1, give up, otherwise pass it to ws_fdopen().

This addresses Coverity CID 1471708.

Also, if ws_fdopen() fails, close the descriptor we got from ws_dup();
this closes a possible FD leak.
2021-01-18 23:31:27 -08:00
Gerald Combs 85a7938925 Qt+tools: Fix most of our lupdate warnings.
Fix various warnings with the following changes:

Pass a list of include directories to lupdate. Fixes:

    ui/qt/proto_tree.cpp:57: Qualifying with unknown namespace/class ::ProtoTree

and similar warnings.

Use QT_TRANSLATE_NOOP instead of QT_TR_NOOP. Fixes:

    ui/qt/lte_rlc_statistics_dialog.cpp:993: tr() cannot be called without context
    ui/qt/lte_mac_statistics_dialog.cpp:911: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:28: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:29: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:30: Discarding unconsumed meta data

Add Q_OBJECT to the class definition. Fixes:

    ui/qt/models/filter_list_model.cpp:120: Class 'FilterListModel' lacks Q_OBJECT macro

The following warnings were not fixed. This might require moving IOGraph
to its own file:

    ui/qt/io_graph_dialog.cpp:320: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:555: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1059: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1485: Qualifying with unknown namespace/class ::IOGraphDialog
2021-01-18 16:56:20 +00:00
Martin Mathieson f504af93f3 PDCP-LTE Zuc integrity + deciphering
As with PDCP-NR, only f8/f9 calls are added - to enable would need
to link against a working Zuc implementation.
2021-01-17 20:41:51 +00:00
Jaap Keuter a260f6a4e0 Correct comment on expert values 2021-01-17 20:08:10 +00:00
Martin Mathieson 2132b3bd40 PDCP-NR: Add ZUC Cipher/integrity calls.
As with Snow3G, we can't distribute Wireshark with NIA3/NEA3
implementations linked in, but provide f8/f9 calls that may be enabled
in private builds.
2021-01-17 19:49:42 +00:00
Gerald Combs 675de0f4f1 [Automatic update for 2021-01-17]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-17 09:47:55 +00:00
Nardi Ivan 9faf6d4e7b QUIC: improve error reporting
When unable to decrypt SH packets we should visualize an error, via
expert info. This way we handle SH and LH errors in the same way.

Close #17077
2021-01-17 06:41:20 +00:00
Martin Mathieson 1979750a78 Spelling: avoid generated files with --commits 2021-01-16 22:59:12 +00:00
Dr. Lars Völker 6a271f90c5 SOME/IP: Change UAT config from dec (0 or 1) to bool.
This patch simplifies the UAT config by using BOOL instead of DEC
to clean up the code as well as fix warnings.

Be aware that this patch changes the format of:
- SOMEIP_parameter_base_types
- SOMEIP_parameter_strings

I will reflect this change in my generation tools available online.
2021-01-16 08:16:10 +00:00
Dr. Lars Völker ad13b877e6 SOME/IP: dissector_delete_all used the TCP handle for udp (BUGFIX)
This patch changes dissector_delete_all to use the correct handle.
2021-01-16 07:59:57 +00:00
Dr. Lars Völker a51713c087 SOME/IP: String endianess was not respected (BUGFIX)
For LE UTF-16 strings the endianess was not respected even when it
was configured. For strings without BOM this could lead to wrong
display of string.

Fixes #17058

Additionally, this patch sets the end of the string correctly.
2021-01-16 07:43:30 +00:00
Dr. Lars Völker 8203e10488 SOME/IP: Fix subdissector support
Until now writing subdissectors for SOME/IP was not really possible.
While you could register for messages, the subdissector did not know
which message it was called for.

This patch fixes the subdissector support of SOME/IP by:
- adding header file to CMakeLists (was missing)
- creating a "data" struct so that subdissectors know what they dissect
- passing this "data" struct to the subdissector
2021-01-16 07:26:08 +00:00
Jirka Novak 737e18d37b SIP Flow: Fixed core dump when dialog opened
Copy&paste typo fixed.
2021-01-16 07:08:46 +00:00
John Thacker 4c1e0dd1fb macos-setup: Support uninstall of QT versions 5.[10-14].x 2021-01-16 02:32:04 +00:00
foreverska 6c65f0586c Register some expert information for a common deviance from spec 2021-01-15 16:58:11 +00:00
foreverska 64033f80f1 Preliminary MODE09 Support 2021-01-15 16:58:11 +00:00
foreverska 569cf94c28 Remove magic numbers; adjust dissection for new payload offsets 2021-01-15 16:58:11 +00:00
Adam Parker 1c3186ef2b OBD2 on CAN rides on ISO15765, made it a subdissector.
- While I recognize that the spec says a request must be 8-bytes long, that's between you and your Tier-1.  I removed this requirement for decode.
- Adjusted byte positions.

Note:
Still needs a 15765 reassembler and when that happens response parsing will need touching up.
2021-01-15 16:58:11 +00:00
Joakim Karlsson 22f4e21cb5 GTPv2: Update IE 8.12 Indication
Change-Id: Ie94427e59b9fb09806718fd3c0429bdf183b8834
2021-01-15 16:57:26 +00:00