mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 12:00:22 +09:00
BACKPORT: wifi: nl80211: Allow authentication frames and set keys on NAN interface
Wi-Fi Aware R4 specification defines NAN Pairing which uses PASN handshake
to authenticate the peer and generate keys. Hence allow to register and transmit
the PASN authentication frames on NAN interface and set the keys to driver or
underlying modules on NAN interface.
The driver needs to configure the feature flag NL80211_EXT_FEATURE_SECURE_NAN,
which also helps userspace modules to know if the driver supports secure NAN.
Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
Link: https://lore.kernel.org/r/1675519179-24174-1-git-send-email-quic_vganneva@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Bug: 272227555
Change-Id: Ib8e15683772cf9696b51fb5360642813ca0a078b
(cherry picked from commit 9b89495e47)
[shivbara: replace reserved UAPI attribute with corresponding upstream
attribute]
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
(cherry picked from commit 092199e995efc58b29d568614581b3f63a05ca8c)
Signed-off-by: Lee Jones <joneslee@google.com>
This commit is contained in:
committed by
Isaac J. Manjarres
parent
a2c880b765
commit
6fba8c7e34
@@ -6303,6 +6303,9 @@ enum nl80211_feature_flags {
|
||||
*
|
||||
* @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.
|
||||
*
|
||||
* @NL80211_EXT_FEATURE_SECURE_NAN: Device supports NAN Pairing which enables
|
||||
* authentication, data encryption and message integrity.
|
||||
*
|
||||
* @NUM_NL80211_EXT_FEATURES: number of extended features.
|
||||
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
|
||||
*/
|
||||
@@ -6372,6 +6375,7 @@ enum nl80211_ext_feature_index {
|
||||
NL80211_EXT_FEATURE_RADAR_BACKGROUND,
|
||||
NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
|
||||
NL80211_EXT_FEATURE_PUNCT,
|
||||
NL80211_EXT_FEATURE_SECURE_NAN,
|
||||
|
||||
/* add new features before the definition below */
|
||||
NUM_NL80211_EXT_FEATURES,
|
||||
|
||||
@@ -1550,10 +1550,14 @@ static int nl80211_key_allowed(struct wireless_dev *wdev)
|
||||
if (wdev->connected)
|
||||
return 0;
|
||||
return -ENOLINK;
|
||||
case NL80211_IFTYPE_NAN:
|
||||
if (wiphy_ext_feature_isset(wdev->wiphy,
|
||||
NL80211_EXT_FEATURE_SECURE_NAN))
|
||||
return 0;
|
||||
return -EINVAL;
|
||||
case NL80211_IFTYPE_UNSPECIFIED:
|
||||
case NL80211_IFTYPE_OCB:
|
||||
case NL80211_IFTYPE_MONITOR:
|
||||
case NL80211_IFTYPE_NAN:
|
||||
case NL80211_IFTYPE_P2P_DEVICE:
|
||||
case NL80211_IFTYPE_WDS:
|
||||
case NUM_NL80211_IFTYPES:
|
||||
@@ -12285,6 +12289,10 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
|
||||
case NL80211_IFTYPE_P2P_DEVICE:
|
||||
break;
|
||||
case NL80211_IFTYPE_NAN:
|
||||
if (!wiphy_ext_feature_isset(wdev->wiphy,
|
||||
NL80211_EXT_FEATURE_SECURE_NAN))
|
||||
return -EOPNOTSUPP;
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
@@ -12342,6 +12350,10 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
break;
|
||||
case NL80211_IFTYPE_NAN:
|
||||
if (!wiphy_ext_feature_isset(wdev->wiphy,
|
||||
NL80211_EXT_FEATURE_SECURE_NAN))
|
||||
return -EOPNOTSUPP;
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
@@ -12479,6 +12491,10 @@ static int nl80211_tx_mgmt_cancel_wait(struct sk_buff *skb, struct genl_info *in
|
||||
case NL80211_IFTYPE_P2P_DEVICE:
|
||||
break;
|
||||
case NL80211_IFTYPE_NAN:
|
||||
if (!wiphy_ext_feature_isset(wdev->wiphy,
|
||||
NL80211_EXT_FEATURE_SECURE_NAN))
|
||||
return -EOPNOTSUPP;
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user