aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlan Peer <[email protected]>2024-06-18 19:44:10 +0300
committerJohannes Berg <[email protected]>2024-06-26 10:28:50 +0200
commita02079af2491b076a4bb6b1a5d668621efbb4b4e (patch)
tree3c22abceaf5a2e0b9ad1838c26d83aa57422197f
parent7714a40561c3905764140cc3e971469671b07187 (diff)
wifi: iwlwifi: mvm: Fix associated initiator key setting
When setting the keys for secure measurement with an AP the station is associated with, the TK should only be referenced and not copied. In addition set the cipher only when the correct station is found. Fixes: 626be4bf99f6 ("wifi: iwlwifi: mvm: modify iwl_mvm_ftm_set_secured_ranging() parameters") Signed-off-by: Ilan Peer <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20240618194245.be2a5327554d.Ie53220b075dacb23a8d073f6008aafd339368592@changeid Signed-off-by: Johannes Berg <[email protected]>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index 00d447e40cc6..afd90a52d4ec 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
@@ -732,10 +732,7 @@ static void iter(struct ieee80211_hw *hw,
WARN_ON(!sta->mfp);
- if (WARN_ON(key->keylen > sizeof(target->tk)))
- return;
-
- memcpy(target->tk, key->key, key->keylen);
+ target->tk = key->key;
*target->cipher = iwl_mvm_cipher_to_location_cipher(key->cipher);
WARN_ON(*target->cipher == IWL_LOCATION_CIPHER_INVALID);
}
@@ -774,9 +771,7 @@ iwl_mvm_ftm_set_secured_ranging(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
!memcmp(vif->bss_conf.bssid, bssid, ETH_ALEN)) {
struct iwl_mvm_ftm_iter_data target;
- target.cipher = cipher;
target.bssid = bssid;
- target.tk = tk;
ieee80211_iter_keys(mvm->hw, vif, iter, &target);
} else {
memcpy(tk, entry->tk, sizeof(entry->tk));