nl80211: add support for SAE authentication offload
Let drivers advertise support for station-mode SAE authentication offload with a new NL80211_EXT_FEATURE_SAE_OFFLOAD flag. Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com> Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:

committed by
Johannes Berg

parent
cc3e14c21a
commit
26f7044e95
@@ -571,6 +571,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
|
||||
[NL80211_ATTR_PEER_MEASUREMENTS] =
|
||||
NLA_POLICY_NESTED(nl80211_pmsr_attr_policy),
|
||||
[NL80211_ATTR_AIRTIME_WEIGHT] = NLA_POLICY_MIN(NLA_U16, 1),
|
||||
[NL80211_ATTR_SAE_PASSWORD] = { .type = NLA_BINARY,
|
||||
.len = SAE_PASSWORD_MAX_LEN },
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
@@ -4434,6 +4436,8 @@ static bool nl80211_valid_auth_type(struct cfg80211_registered_device *rdev,
|
||||
return true;
|
||||
case NL80211_CMD_CONNECT:
|
||||
if (!(rdev->wiphy.features & NL80211_FEATURE_SAE) &&
|
||||
!wiphy_ext_feature_isset(&rdev->wiphy,
|
||||
NL80211_EXT_FEATURE_SAE_OFFLOAD) &&
|
||||
auth_type == NL80211_AUTHTYPE_SAE)
|
||||
return false;
|
||||
|
||||
@@ -8973,6 +8977,16 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
|
||||
settings->psk = nla_data(info->attrs[NL80211_ATTR_PMK]);
|
||||
}
|
||||
|
||||
if (info->attrs[NL80211_ATTR_SAE_PASSWORD]) {
|
||||
if (!wiphy_ext_feature_isset(&rdev->wiphy,
|
||||
NL80211_EXT_FEATURE_SAE_OFFLOAD))
|
||||
return -EINVAL;
|
||||
settings->sae_pwd =
|
||||
nla_data(info->attrs[NL80211_ATTR_SAE_PASSWORD]);
|
||||
settings->sae_pwd_len =
|
||||
nla_len(info->attrs[NL80211_ATTR_SAE_PASSWORD]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user