History

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.

Vinay Gannevaram committed 3 years ago

Commit 9b894951 parent aaacf172 files · +21 −1Browse files

Unified · Split

2 files
  1. include/uapi/linux/nl80211.h +4 −0
  2. net/wireless/nl80211.c +17 −1
include/uapi/linux/nl80211.h+4−0
@@ -6323,6 +6323,9 @@ enum nl80211_feature_flags { · 6322 unmodified lines
63236323 *
63246324 * @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.
63256325 *
6326+ * @NL80211_EXT_FEATURE_SECURE_NAN: Device supports NAN Pairing which enables
6327+ * authentication, data encryption and message integrity.
6328+ *
63266329 * @NUM_NL80211_EXT_FEATURES: number of extended features.
63276330 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
63286331 */
@@ -6392,6 +6395,7 @@ enum nl80211_ext_feature_index { · 63 unmodified lines
63926395 NL80211_EXT_FEATURE_RADAR_BACKGROUND,
63936396 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
63946397 NL80211_EXT_FEATURE_PUNCT,
6398+ NL80211_EXT_FEATURE_SECURE_NAN,
63956399
63966400 /* add new features before the definition below */
63976401 NUM_NL80211_EXT_FEATURES,
net/wireless/nl80211.c+17−1
@@ -1549,10 +1549,14 @@ static int nl80211_key_allowed(struct wireless_dev *wdev) · 1548 unmodified lines
15491549 if (wdev->connected)
15501550 return 0;
15511551 return -ENOLINK;
1552+ case NL80211_IFTYPE_NAN:
1553+ if (wiphy_ext_feature_isset(wdev->wiphy,
1554+ NL80211_EXT_FEATURE_SECURE_NAN))
1555+ return 0;
1556+ return -EINVAL;
15521557 case NL80211_IFTYPE_UNSPECIFIED:
15531558 case NL80211_IFTYPE_OCB:
15541559 case NL80211_IFTYPE_MONITOR:
1555− case NL80211_IFTYPE_NAN:
15561560 case NL80211_IFTYPE_P2P_DEVICE:
15571561 case NL80211_IFTYPE_WDS:
15581562 case NUM_NL80211_IFTYPES:
@@ -12342,6 +12346,10 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info) · 10783 unmodified lines
1234212346 case NL80211_IFTYPE_P2P_DEVICE:
1234312347 break;
1234412348 case NL80211_IFTYPE_NAN:
12349+ if (!wiphy_ext_feature_isset(wdev->wiphy,
12350+ NL80211_EXT_FEATURE_SECURE_NAN))
12351+ return -EOPNOTSUPP;
12352+ break;
1234512353 default:
1234612354 return -EOPNOTSUPP;
1234712355 }
@@ -12399,6 +12407,10 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) · 51 unmodified lines
1239912407 case NL80211_IFTYPE_P2P_GO:
1240012408 break;
1240112409 case NL80211_IFTYPE_NAN:
12410+ if (!wiphy_ext_feature_isset(wdev->wiphy,
12411+ NL80211_EXT_FEATURE_SECURE_NAN))
12412+ return -EOPNOTSUPP;
12413+ break;
1240212414 default:
1240312415 return -EOPNOTSUPP;
1240412416 }
@@ -12536,6 +12548,10 @@ static int nl80211_tx_mgmt_cancel_wait(struct sk_buff *skb, struct genl_info *in · 131 unmodified lines
1253612548 case NL80211_IFTYPE_P2P_DEVICE:
1253712549 break;
1253812550 case NL80211_IFTYPE_NAN:
12551+ if (!wiphy_ext_feature_isset(wdev->wiphy,
12552+ NL80211_EXT_FEATURE_SECURE_NAN))
12553+ return -EOPNOTSUPP;
12554+ break;
1253912555 default:
1254012556 return -EOPNOTSUPP;
1254112557 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t