Commit Graph

1056 Commits

Author SHA1 Message Date
Teyut efabf1d291 wlan: fix wrong reported length for reassembled payloads
There is no need to remove the FCS at the end of the reassembled payload since FCS bytes have already been removed from the fragments. Also, the way it was removed in the code was wrong: it set the reported length of the reassembled payload to the reported length of the last fragment only.

Revert "ieee802.11: Make sure we do not include the FCS in the next_tvb."

This reverts commit 094297ec77.
2020-12-18 11:40:22 +00:00
Jim Young 9fb22c1ec0 Four trivial comment typo fixes of ‘ad’ to ‘as’ 2020-12-06 19:07:08 +00:00
Guy Harris a3e952344d wlan: don't commit to the "OLPC"/"Atheros" stuff being either of them.
We don't necessarily know why that stuff is there; is it some stuff used
in OLPC mesh networks (mesh control header), is it something added by
Ruckus wireless devices, is it something added by Atheros used by the
Ruckus devices, or something else?  Sometimes the Ruckus devices seem to
add an OLPC-like 0x00 0x00, and sometimes they seem to add a copy of the
sequence number.

So just call it "Mysterious extra OLPC/Ruckus/Atheros/??? stuff".
2020-12-04 22:14:56 -08:00
Guy Harris 872fb08aad wlan, llc: support EPD and LPD for 802.11 frames.
Replace the special-purpose hack in the 802.2 LLC dissector for WSMP,
Ethertype 0x88DC, with a general mechanism in the 802.11 dissector to
attempt to determine whether the frame uses Ethertype protocol
discrimination (EPD) or LLC protocol discrimination (LPD) at the LLC
sublayer, as defined in IEEE Std 802-2014.
2020-12-04 17:45:45 -08:00
Guy Harris 00d45cc71a wlan: fix a bug-number typo in comments. 2020-12-04 04:37:32 -08:00
Guy Harris 3c640ca04a wlan: never treat DMG frames as if they have an HT Control field.
At least one ns-3 capture has DMG frames (as indicated by the channel
number being in the 60 GHz band - radiotap currently has no DMG metadata
field) that have the +HTC/Order flag subfield set but have no HT Control
field, causing them to be misdissected.

802.11-2016 says that DMG frames should never have +HTC/Order set; if it
*is* set in a QoS frame known to be a DMG frame, flag it with an expert
info item and don't treat it as having an HT Control field.

Update a bunch of comments to give more information, put comments in the
appropriate places, and speak of 802.11-2016 rather than older standards.

While we're at it, update the title and description of the +HTC/Order
flag to reflect its name as of 802.11-2016.
2020-12-03 12:03:54 -08:00
Guy Harris ac0cf10ab0 PI_MALFORMED is not a valid error severity; fix it to PI_ERROR. 2020-12-03 03:42:19 -08:00
Thiyagarajan P 6035312ea9 Support to dissect PXU and PXUC
Added support for dissecting the PXU element
IEEE80211-2016, section 9.4.2.116

Added support for dissecting the PXUC element
IEEE80211-2016, section 9.4.2.117
2020-12-03 08:33:26 +00:00
Guy Harris 1fa5687fad wlan: don't treat non-QoS frames as having an HT Control field.
That's QoS-frame only; for non-QoS frames, the +HTC/Order subfield
doesn't mean there's an HT Control field.

Update the reference to the part of the 802.11 standard mentioning that
subfield to 802.11-2016.
2020-11-30 06:41:55 +00:00
Guy Harris baee4a41c7 wlan: clean up some tests.
It's clearer to say

    if (A) {
        if (B) {
            do this;
        } else {
            do that;
        }
    }

than to say

    if (A && B) {
        do this;
    } else if (A && !B) {
        do that;
    }
2020-11-29 18:24:53 -08:00
Guy Harris 258fb14821 802.11: clean up data frame handling.
Change

    case DATA_FRAME:
        if (condition) {
            do stuff;
            break;
        }
        do other stuff;
        break;

to

    case DATA_FRAME:
        if (condition) {
            do stuff;
        } else {
            do other stuff;
        }
        break;

to make it clearer that it's "do this if condition is true, else do
that".
2020-11-29 02:17:47 -08:00
Martin Mathieson 646bfde7fa Fix some filter names.
Detected by 'tools/check_typed_item_calls.py --consecutive'
2020-11-14 21:22:42 +00:00
Thiyagarajan P cda11f813d Support to dissect Gate Announcement
Added support for dissecting the Gate Announcement element
IEEE80211-2016, section 9.4.2.111
2020-11-02 12:11:56 +00:00
Martin Mathieson 723d0fab8f IEEE80211: Fix the lengths of a couple of items
Found by running ./tools/check_typed_item_calls.py

epan/dissectors/packet-ieee80211.c:14209 proto_tree_add_item called for hf_ieee80211_osen_akm_count  -  item type is FT_UINT8 but call has len  2
epan/dissectors/packet-ieee80211.c:20025 proto_tree_add_item called for hf_ieee80211_tclas_ether_type  -  item type is FT_UINT8 but call has len  2
2020-10-19 06:26:47 +00:00
Thiyagarajan P c1950aa8cc ieee80211:Fix ieee80211_tag_beacon_timing() beacon timing element length check. 2020-10-13 19:33:09 +00:00
Francisco Jose Alvarez 4189581cc9 ieee80211: Fix dissect_hs20_osu_provider() return parameter
With the current return parameter of dissect_hs20_osu_provider() function, the dissector only show the first
osu_provider of the list. Changing the return end by return offset, the
dissector show all osu_provider of the list.
2020-10-08 18:23:56 +00:00
Martin Mathieson 2ecd9f6818 IEEE 802.11: Use common filter string for action_code
For radio measurements, use same filter string as most others,
i.e. wlan.fixed.action_code.
2020-09-28 23:29:01 +00:00
Thiyagarajan P 78466d1046 Support to dissect beacon timing element
Added support for dissecting the beacon timing element.
IEEE80211-2016, section 9.4.2.105.
2020-09-13 20:16:07 +00:00
Martin Mathieson a2a3e38fdb Fix some more dissector spellings. 2020-09-10 11:26:16 +00:00
Alexis La Goutte a4319f3254 ieee80211: fix Wmissing-prototypes
no previous prototype for function 'add_ff_action_public_fields' [-Wmissing-prototypes]

Change-Id: I8be64454a21187cf60a04c903acfbb18f2a12095
2020-09-09 06:06:29 +00:00
Martin Mathieson d461bf3025 Yet more spelling fixes.
Includes small updates to the script and wireshark dictionary.
Probably the last spelling fixes from me for a while.
2020-09-07 16:35:13 +01:00
Martin Mathieson 2999b7f6b3 More spelling fixes, part 2 of 2nd pass of dissectors. 2020-08-31 12:39:37 +01:00
Martin Mathieson 4c9f59ee56 Fix more spelling errors in dissector strings.
A second batch of spelling errors, detected using a script
that uses pyspellcheck and a Wireshark-specific dictionary file.

I will take at least one more pass through the dissectors, as
further improvements are made to the script.
2020-08-29 21:32:39 +00:00
Matthew Weant c462f72273 IEEE802.11: WAN Metrics Length Check Update
Replaced tvb_captured_length_remaining() with
tvb_reported_length_remaining().

Change-Id: I87c07488590cd82ca8a945ac6f13efa45807e55b
Reviewed-on: https://code.wireshark.org/review/37098
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-10 20:06:43 +00:00
Guy Harris b711b300cc netmon: handle non-monitor-mode 802.11 packets differently.
Microsoft Network Monitor lets you capture on an 802.11 adapter either
in monitor mode or in non-monitor mode; frames captured in non-monitor
mode may have the Protected bit set in the 802.11 header, but are
decrypted and don't incclude encryption information, and may have the
A-MSDU Present flag set in the QoS Control field, but have just a
regular frame payload, not a sequence of A-MSDUs, in the payload field.

Dissect those frames correctly.

Bug: 16758
Change-Id: I42b7e9ce52faa80222692403fa7276c039644343
Reviewed-on: https://code.wireshark.org/review/38082
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-08-07 18:07:57 +00:00
Richard Sharpe cb8fa30177 ieee1905: Comform to the latest Multi-AP spec plus add reassembly.
Here we conform to the latest ieee1905 Multi-AP spec as tested by the
WFA. We also add support for reassembling ieee1905 messages.

Bug: 16660
Change-Id: Ic67784d7c213856a364f88c177ede9688271ea2a
Reviewed-on: https://code.wireshark.org/review/37574
Petri-Dish: Richard Sharpe <realrichardsharpe@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-13 05:15:15 +00:00
Yann Pomarède 7ed3180a29 ieee80211: add VS SGDSN type 1 message
Bug: 16680
Change-Id: Ia540d252371a045e4d1c0b0e2eb87db8fa21fc31
Reviewed-on: https://code.wireshark.org/review/37681
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-07-08 06:29:00 +00:00
Richard Sharpe b1ec5ddff6 ieee80211: Remove duplicate and erroneous entries in the status code table.
Also, the status code 125 is duplicated. This mistake was probably
introduced from Draft P802.11Revmd_D3.0.pdf. I have commented out that
status code while I get clarification on the real value.
Change-Id: Id41e1da953a28ca6b098f6c96d6410dff04dc6d7
Reviewed-on: https://code.wireshark.org/review/37708
Petri-Dish: Richard Sharpe <realrichardsharpe@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-07-06 09:06:48 +00:00
Alexis La Goutte 1a8b67c772 ieee80211: Fix bitmask of RNSX fields
Change-Id: I3921085cbdfef55909333fe13f5cee58a78b10c8
Reviewed-on: https://code.wireshark.org/review/37630
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-02 14:34:39 +00:00
Alexis La Goutte ba1777cb6e ieee80211: update status code (from 802.11REVmd May 2020)
Change-Id: Ica4e3c1651bda5dbc7b4d77140520ac4db91b792
Reviewed-on: https://code.wireshark.org/review/37538
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-22 15:43:18 +00:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +00:00
Alexis La Goutte 4dc64b44aa ieee80211: fix BSS menbership (wrong value)
Change-Id: I54455eb441b7f222ab118f0187f88491a02c68cd
Reviewed-on: https://code.wireshark.org/review/37491
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-17 06:10:35 +00:00
Alexis La Goutte 231663a0fb 802.11: Add BSS membership selector to supported(and extended) rates Tag
Change-Id: I62821de732de36302aa731c9a033c521abb5f6e6
Reviewed-on: https://code.wireshark.org/review/37456
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-12 11:12:30 +00:00
Alexis La Goutte ec0403acb4 ieee80211: Add RSN eXtension (Tag 244)
Change-Id: I6b10f6ece7e6a50f3538ea97ac75a0ec654e434e
Reviewed-on: https://code.wireshark.org/review/37407
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-10 13:21:53 +00:00
Mikael Kanstrup 42544c8c44 dot11decrypt: Support decryption using TK user input
Add support for TK user input keys. With this Wireshark can
decrypt packet captures where 4WHS frames are missing and
packet captures with non-supported AKMS, for example
802.11r / Fast BSS Transitioning.

Decryption using user TK works as a backup if the normal
decryption flow does not succeed. Having TK decryption keys
added will affect general IEEE 802.11 dissector performance
as each encrypted packet will be tested with every TK.
Worst case scenario is plenty of TKs where none of them
matches encrypted frames.

On successful user TK decryption an SA is formed based on
parameters used to decrypt the frame. This SA is similar to
what is formed when Wireshark detects and derive keys from
4WHS messages. With the SA entry in place the decryption
performance (success case) should be on par with "normal"
decryption flow.

Bug: 16579
Change-Id: I72c2c1e2c6693131d3ba07f8ddb8ff772c1b54a9
Reviewed-on: https://code.wireshark.org/review/37217
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-01 07:23:56 +00:00
Mikael Kanstrup 62f25dfa64 dot11decrypt: Use hash table to store SA entries
Simplify the SA storage by replacing the static array with a
hash table. This way there's no need to keep track of whether
an entry is used or not and no need to traverse the whole
array for the non-matching case. This change should benefit
performance but was mainly done to prepare for coming changes
where code adding and searching for SA entries is modified. With
this change in place those changes become cleaner.

Change-Id: Ide572c5e4e7e872f1654d8d8f288cd6451f04435
Reviewed-on: https://code.wireshark.org/review/37307
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-25 12:31:37 +00:00
Mikael Kanstrup 685a125729 dot11decrypt: Remove some unused code
Remove some unused defines, function parameters and functions.

Change-Id: I1bbc3ff7e0a9d11e8521ddf24b35113d8e332f08
Reviewed-on: https://code.wireshark.org/review/37305
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-25 10:33:23 +00:00
Matthew Weant 0817970d24 IEEE802.11: Added HS2.0 ANQP Oper Class Indic Info
Added range_string for Operating Indicator Class
information to support Hotspot 2.0 ANQP messages

Bug: 16568
Change-Id: I98db7aed00703cf329d5a96d317bdf655a0f3dcd
Reviewed-on: https://code.wireshark.org/review/37245
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-05-20 06:13:18 +00:00
Matthew Weant 05c06d04cc IEEE802.11: Added Hotspot 2.0 ANQP Connection Capability Info
Adding Hotspot 2.0 ANQP Connection Capability Information
so the IP protocol and port assignments show up in the GUI
based on the Hotspot 2.0 documentation and implementation details.

Bug: 16569
Change-Id: Ic3e26e04c5d48269d59b6604b125569328c82faf
Reviewed-on: https://code.wireshark.org/review/37246
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-05-20 06:12:29 +00:00
Matthew Weant 9e52936b2b IEEE802.11: Adding ANQP Type 280 per IEEE 802.11-2016
Adding ANQP Type 280 - Network Authentication Type
Information with Timestamp per IEEE 802.11-2016 standard
and adding fields required for timestamp values.

Bug: 16570
Change-Id: Ifbe5d8abc40fcb543c2abaa7478d5feaae2f7945
Reviewed-on: https://code.wireshark.org/review/37247
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-05-20 06:12:10 +00:00
Matthew Weant 87f320ec25 IEEE802.11: HS2.0 ANQP Friendly Name Subtree Fix
Set index start to 1 for Friendly Operator Name subtree.
Moved lang code and name string within subtree.

Bug: 16534
Change-Id: I0fd4d926f585ec432a869c7a15e13b84d5d0f2fb
Reviewed-on: https://code.wireshark.org/review/36996
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-07 11:34:37 +00:00
Matthew Weant 9279be0394 IEEE802.11: Fixed HS2.0 Cap List Dissection
Adjusted dissect_anqp_capab_list() to include
~anqp_subtype and ~anqp_reserved fields when
WFA HS2.0 exists as a vendor-specific capability ID.

Bug: 16548
Change-Id: I2923df3f6de42a58af643cd07b29c77e802cdcab
Reviewed-on: https://code.wireshark.org/review/37147
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-07 11:33:42 +00:00
Alexis La Goutte ada193f6ad ieee80211: fix typo naqp => anqp
Bug: 16520
Change-Id: If44494d59e325f2fdba99c2b37992a9243b3ed76
Reviewed-on: https://code.wireshark.org/review/36982
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-30 08:41:21 +00:00
Cedric Izoard 628c6ff520 ieee80211: Fix minor errors in WFA MBO-OCE element
- Fix some fields name
- Use BASE_UNIT to display fields units

Bug: 16494
Change-Id: I004c720bb53fd8afe64494d2574efc137ca94ccf
Reviewed-on: https://code.wireshark.org/review/36874
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-17 22:52:03 +00:00
Cedric Izoard 97bbe25151 ieee80211: Allow vendor element in WNM transition req/resp
In Wi-Fi Agile Multiband Technical Specification it is specified that
'BSS Transition Candidate List Entries' found in WNM Transition
management request/response action frame may contain WFA vendor
specific element.

Bug: 16494
Change-Id: Ifa7a2b1a6da48e6d4920e896340c3671cfb9625e
Reviewed-on: https://code.wireshark.org/review/36871
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-17 22:51:44 +00:00
Cedric Izoard 989ffe78d3 ieee80211: Fix BSS termination in WNM BSS transition request
When present in WNM Transition management request, 'BSS Termination
Duration' has the same format as the sub element in neighbor report
element and not just a single 64bits value.

Bug: 16494
Change-Id: I3a5a0659fa9e81e97de7a99fea2cffa6a58eea0e
Reviewed-on: https://code.wireshark.org/review/36870
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-17 22:51:22 +00:00
Cedric Izoard adf3826e9f ieee80211: Dissect WFA WNM notification request
"Wi-fi Agile Multiband" specification also defines WFA vendor specific
sub-elements for WNM notification request.

For simplicity treat those sub-element as normal WFA vendor specific
elements. This is OK as the 'OUI type' for those sub-elements doesn't
clash with 'OUI type' defined for normal elements.

Bug: 16494
Change-Id: Id2321ec283647a6db4be7f475fd5fc107596f854
Reviewed-on: https://code.wireshark.org/review/36869
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-04-17 18:58:29 +00:00
Cedric Izoard 67ce4722fb ieee80211: Dissect OCE attributes of WFA MBO-OCE element
This patch complete dissection of WFA vendor specific MBO-OCE element
with the OCE attributes.
The OCE attributes are defined in 'Optimized Connectivity Experience'
specification. (version 1.1 has been used as reference).

Bug: 16494
Change-Id: I366f230efe1029ca2b97da78a8b80371c438043e
Reviewed-on: https://code.wireshark.org/review/36868
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-17 12:27:27 +00:00
Cedric Izoard 798e6aee36 ieee80211: Dissect WFA MBO ANQP element
Add parsing of MBO ANQP element as defined by 'Wi-Fi Agile Multiband'
specification (v1.4)

Bug: 16494
Change-Id: If03a9d474912a607fa1752ac1f787b71a45e0fa6
Reviewed-on: https://code.wireshark.org/review/36867
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-17 12:03:55 +00:00
Cedric Izoard cad371a59d ieee80211: Fix length in vendor specific ANQP data subset
For Vendor Specific ANQP element the OUI is not included in the packet
subset dissected by the anqp vendor specific function so adapt the
length accordingly.

Bug: 16494
Change-Id: I8082fdabc379cb3ea71c01e6fb009f49afd16dff
Reviewed-on: https://code.wireshark.org/review/36866
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-17 11:45:24 +00:00