]> git.hungrycats.org Git - linux/commitdiff
wifi: iwlwifi: mvm: Handle BIGTK cipher in kek_kck cmd
authorYedidya Benshimol <yedidya.ben.shimol@intel.com>
Mon, 13 May 2024 10:27:09 +0000 (13:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2024 07:53:21 +0000 (09:53 +0200)
[ Upstream commit 08b16d1b5997dc378533318e2a9cd73c7a898284 ]

The BIGTK cipher field was added to the kek_kck_material_cmd
but wasn't assigned. Fix that by differentiating between the
IGTK/BIGTK keys and assign the ciphers fields accordingly.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240513132416.7fd0b22b7267.Ie9b581652b74bd7806980364d59e1b2e78e682c0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c

index 74743c3ceeefb1531991ea2c36f74d129831283a..6f16b5b33f0c0b33bb12aac9b0dc64666e7973db 100644 (file)
@@ -595,6 +595,12 @@ static void iwl_mvm_wowlan_gtk_type_iter(struct ieee80211_hw *hw,
                                         void *_data)
 {
        struct wowlan_key_gtk_type_iter *data = _data;
+       __le32 *cipher = NULL;
+
+       if (key->keyidx == 4 || key->keyidx == 5)
+               cipher = &data->kek_kck_cmd->igtk_cipher;
+       if (key->keyidx == 6 || key->keyidx == 7)
+               cipher = &data->kek_kck_cmd->bigtk_cipher;
 
        switch (key->cipher) {
        default:
@@ -606,10 +612,13 @@ static void iwl_mvm_wowlan_gtk_type_iter(struct ieee80211_hw *hw,
                return;
        case WLAN_CIPHER_SUITE_BIP_GMAC_256:
        case WLAN_CIPHER_SUITE_BIP_GMAC_128:
-               data->kek_kck_cmd->igtk_cipher = cpu_to_le32(STA_KEY_FLG_GCMP);
+               if (cipher)
+                       *cipher = cpu_to_le32(STA_KEY_FLG_GCMP);
                return;
        case WLAN_CIPHER_SUITE_AES_CMAC:
-               data->kek_kck_cmd->igtk_cipher = cpu_to_le32(STA_KEY_FLG_CCM);
+       case WLAN_CIPHER_SUITE_BIP_CMAC_256:
+               if (cipher)
+                       *cipher = cpu_to_le32(STA_KEY_FLG_CCM);
                return;
        case WLAN_CIPHER_SUITE_CCMP:
                if (!sta)