alt_key = wiphy_dereference(sdata->local->hw.wiphy,
sta->ptk[idx ^ 1]);
- /* The rekey code assumes that the old and new key are using
+ /*
+ * The rekey code assumes that the old and new key are using
* the same cipher. Enforce the assumption for pairwise keys.
+ * NAN Data interfaces are exempt: Wi-Fi Aware v4.0 section 7.4
+ * requires upgrading the ND-TKSA when a new NDP negotiates a
+ * stronger cipher suite.
*/
- if ((alt_key && alt_key->conf.cipher != key->conf.cipher) ||
- (old_key && old_key->conf.cipher != key->conf.cipher)) {
+ if (sdata->vif.type != NL80211_IFTYPE_NAN_DATA &&
+ ((alt_key && alt_key->conf.cipher != key->conf.cipher) ||
+ (old_key && old_key->conf.cipher != key->conf.cipher))) {
ret = -EOPNOTSUPP;
goto out;
}