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
6323 *6323 *
6324 * @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.6324 * @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.
6325 *6325 *
6326 * @NL80211_EXT_FEATURE_SECURE_NAN: Device supports NAN Pairing which enables
6327 * authentication, data encryption and message integrity.
6328 *
6326 * @NUM_NL80211_EXT_FEATURES: number of extended features.6329 * @NUM_NL80211_EXT_FEATURES: number of extended features.
6327 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.6330 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
6328 */6331 */
@@ -6392,6 +6395,7 @@ enum nl80211_ext_feature_index { · 63 unmodified lines
6392 NL80211_EXT_FEATURE_RADAR_BACKGROUND,6395 NL80211_EXT_FEATURE_RADAR_BACKGROUND,
6393 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,6396 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
6394 NL80211_EXT_FEATURE_PUNCT,6397 NL80211_EXT_FEATURE_PUNCT,
6398 NL80211_EXT_FEATURE_SECURE_NAN,
6395 6399
6396 /* add new features before the definition below */6400 /* add new features before the definition below */
6397 NUM_NL80211_EXT_FEATURES,6401 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
1549 if (wdev->connected)1549 if (wdev->connected)
1550 return 0;1550 return 0;
1551 return -ENOLINK;1551 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;
1552 case NL80211_IFTYPE_UNSPECIFIED:1557 case NL80211_IFTYPE_UNSPECIFIED:
1553 case NL80211_IFTYPE_OCB:1558 case NL80211_IFTYPE_OCB:
1554 case NL80211_IFTYPE_MONITOR:1559 case NL80211_IFTYPE_MONITOR:
1555 case NL80211_IFTYPE_NAN:
1556 case NL80211_IFTYPE_P2P_DEVICE:1560 case NL80211_IFTYPE_P2P_DEVICE:
1557 case NL80211_IFTYPE_WDS:1561 case NL80211_IFTYPE_WDS:
1558 case NUM_NL80211_IFTYPES:1562 case NUM_NL80211_IFTYPES:
@@ -12342,6 +12346,10 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info) · 10783 unmodified lines
12342 case NL80211_IFTYPE_P2P_DEVICE:12346 case NL80211_IFTYPE_P2P_DEVICE:
12343 break;12347 break;
12344 case NL80211_IFTYPE_NAN:12348 case NL80211_IFTYPE_NAN:
12349 if (!wiphy_ext_feature_isset(wdev->wiphy,
12350 NL80211_EXT_FEATURE_SECURE_NAN))
12351 return -EOPNOTSUPP;
12352 break;
12345 default:12353 default:
12346 return -EOPNOTSUPP;12354 return -EOPNOTSUPP;
12347 }12355 }
@@ -12399,6 +12407,10 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info) · 51 unmodified lines
12399 case NL80211_IFTYPE_P2P_GO:12407 case NL80211_IFTYPE_P2P_GO:
12400 break;12408 break;
12401 case NL80211_IFTYPE_NAN:12409 case NL80211_IFTYPE_NAN:
12410 if (!wiphy_ext_feature_isset(wdev->wiphy,
12411 NL80211_EXT_FEATURE_SECURE_NAN))
12412 return -EOPNOTSUPP;
12413 break;
12402 default:12414 default:
12403 return -EOPNOTSUPP;12415 return -EOPNOTSUPP;
12404 }12416 }
@@ -12536,6 +12548,10 @@ static int nl80211_tx_mgmt_cancel_wait(struct sk_buff *skb, struct genl_info *in · 131 unmodified lines
12536 case NL80211_IFTYPE_P2P_DEVICE:12548 case NL80211_IFTYPE_P2P_DEVICE:
12537 break;12549 break;
12538 case NL80211_IFTYPE_NAN:12550 case NL80211_IFTYPE_NAN:
12551 if (!wiphy_ext_feature_isset(wdev->wiphy,
12552 NL80211_EXT_FEATURE_SECURE_NAN))
12553 return -EOPNOTSUPP;
12554 break;
12539 default:12555 default:
12540 return -EOPNOTSUPP;12556 return -EOPNOTSUPP;
12541 }12557 }

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