nl80211: support SAE authentication offload in AP mode
Let drivers advertise support for AP-mode SAE authentication offload with a new NL80211_EXT_FEATURE_SAE_OFFLOAD_AP flag. Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com> Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com> Link: https://lore.kernel.org/r/20200817073316.33402-4-stanley.hsu@cypress.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:

committed by
Johannes Berg

parent
8552a434b6
commit
2831a63102
@@ -252,9 +252,13 @@
|
|||||||
* DOC: SAE authentication offload
|
* DOC: SAE authentication offload
|
||||||
*
|
*
|
||||||
* By setting @NL80211_EXT_FEATURE_SAE_OFFLOAD flag drivers can indicate they
|
* By setting @NL80211_EXT_FEATURE_SAE_OFFLOAD flag drivers can indicate they
|
||||||
* support offloading SAE authentication for WPA3-Personal networks. In
|
* support offloading SAE authentication for WPA3-Personal networks in station
|
||||||
* %NL80211_CMD_CONNECT the password for SAE should be specified using
|
* mode. Similarly @NL80211_EXT_FEATURE_SAE_OFFLOAD_AP flag can be set by
|
||||||
* %NL80211_ATTR_SAE_PASSWORD.
|
* drivers indicating the offload support in AP mode.
|
||||||
|
*
|
||||||
|
* The password for SAE should be specified using %NL80211_ATTR_SAE_PASSWORD in
|
||||||
|
* %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP for station and AP mode
|
||||||
|
* respectively.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5845,6 +5849,9 @@ enum nl80211_feature_flags {
|
|||||||
* handshake with PSK in AP mode (PSK is passed as part of the start AP
|
* handshake with PSK in AP mode (PSK is passed as part of the start AP
|
||||||
* command).
|
* command).
|
||||||
*
|
*
|
||||||
|
* @NL80211_EXT_FEATURE_SAE_OFFLOAD_AP: Device wants to do SAE authentication
|
||||||
|
* in AP mode (SAE password is passed as part of the start AP command).
|
||||||
|
*
|
||||||
* @NUM_NL80211_EXT_FEATURES: number of extended features.
|
* @NUM_NL80211_EXT_FEATURES: number of extended features.
|
||||||
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
|
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
|
||||||
*/
|
*/
|
||||||
@@ -5902,6 +5909,7 @@ enum nl80211_ext_feature_index {
|
|||||||
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS,
|
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS,
|
||||||
NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION,
|
NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION,
|
||||||
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK,
|
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK,
|
||||||
|
NL80211_EXT_FEATURE_SAE_OFFLOAD_AP,
|
||||||
|
|
||||||
/* add new features before the definition below */
|
/* add new features before the definition below */
|
||||||
NUM_NL80211_EXT_FEATURES,
|
NUM_NL80211_EXT_FEATURES,
|
||||||
|
@@ -4960,8 +4960,9 @@ static bool nl80211_valid_auth_type(struct cfg80211_registered_device *rdev,
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
case NL80211_CMD_START_AP:
|
case NL80211_CMD_START_AP:
|
||||||
/* SAE not supported yet */
|
if (!wiphy_ext_feature_isset(&rdev->wiphy,
|
||||||
if (auth_type == NL80211_AUTHTYPE_SAE)
|
NL80211_EXT_FEATURE_SAE_OFFLOAD_AP) &&
|
||||||
|
auth_type == NL80211_AUTHTYPE_SAE)
|
||||||
return false;
|
return false;
|
||||||
/* FILS not supported yet */
|
/* FILS not supported yet */
|
||||||
if (auth_type == NL80211_AUTHTYPE_FILS_SK ||
|
if (auth_type == NL80211_AUTHTYPE_FILS_SK ||
|
||||||
@@ -9552,7 +9553,9 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
|
|||||||
|
|
||||||
if (info->attrs[NL80211_ATTR_SAE_PASSWORD]) {
|
if (info->attrs[NL80211_ATTR_SAE_PASSWORD]) {
|
||||||
if (!wiphy_ext_feature_isset(&rdev->wiphy,
|
if (!wiphy_ext_feature_isset(&rdev->wiphy,
|
||||||
NL80211_EXT_FEATURE_SAE_OFFLOAD))
|
NL80211_EXT_FEATURE_SAE_OFFLOAD) &&
|
||||||
|
!wiphy_ext_feature_isset(&rdev->wiphy,
|
||||||
|
NL80211_EXT_FEATURE_SAE_OFFLOAD_AP))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
settings->sae_pwd =
|
settings->sae_pwd =
|
||||||
nla_data(info->attrs[NL80211_ATTR_SAE_PASSWORD]);
|
nla_data(info->attrs[NL80211_ATTR_SAE_PASSWORD]);
|
||||||
|
Reference in New Issue
Block a user