OCV: Advertise OCV capability in RSN capabilities (STA)

Set the OCV bit in RSN capabilities (RSNE) based on station mode
configuration.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
This commit is contained in:
Mathy Vanhoef 2018-08-06 15:46:25 -04:00 committed by Jouni Malinen
parent 1e93e4239f
commit 55c12f5d37
6 changed files with 15 additions and 1 deletions

View file

@ -2864,6 +2864,9 @@ int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
case WPA_PARAM_MFP: case WPA_PARAM_MFP:
sm->mfp = value; sm->mfp = value;
break; break;
case WPA_PARAM_OCV:
sm->ocv = value;
break;
default: default:
break; break;
} }
@ -3817,6 +3820,8 @@ static int fils_ft_build_assoc_req_rsne(struct wpa_sm *sm, struct wpabuf *buf)
if (sm->mgmt_group_cipher == WPA_CIPHER_AES_128_CMAC) if (sm->mgmt_group_cipher == WPA_CIPHER_AES_128_CMAC)
capab |= WPA_CAPABILITY_MFPC; capab |= WPA_CAPABILITY_MFPC;
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
if (sm->ocv)
capab |= WPA_CAPABILITY_OCVC;
wpabuf_put_le16(buf, capab); wpabuf_put_le16(buf, capab);
/* PMKID Count */ /* PMKID Count */

View file

@ -97,7 +97,8 @@ enum wpa_sm_conf_params {
WPA_PARAM_KEY_MGMT, WPA_PARAM_KEY_MGMT,
WPA_PARAM_MGMT_GROUP, WPA_PARAM_MGMT_GROUP,
WPA_PARAM_RSN_ENABLED, WPA_PARAM_RSN_ENABLED,
WPA_PARAM_MFP WPA_PARAM_MFP,
WPA_PARAM_OCV
}; };
struct rsn_supp_config { struct rsn_supp_config {

View file

@ -242,6 +242,8 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
sm->mgmt_group_cipher == WPA_CIPHER_BIP_CMAC_256) sm->mgmt_group_cipher == WPA_CIPHER_BIP_CMAC_256)
capab |= WPA_CAPABILITY_MFPC; capab |= WPA_CAPABILITY_MFPC;
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
if (sm->ocv)
capab |= WPA_CAPABILITY_OCVC;
WPA_PUT_LE16(pos, capab); WPA_PUT_LE16(pos, capab);
pos += 2; pos += 2;

View file

@ -86,6 +86,7 @@ struct wpa_sm {
int rsn_enabled; /* Whether RSN is enabled in configuration */ int rsn_enabled; /* Whether RSN is enabled in configuration */
int mfp; /* 0 = disabled, 1 = optional, 2 = mandatory */ int mfp; /* 0 = disabled, 1 = optional, 2 = mandatory */
int ocv; /* Operating Channel Validation */
u8 *assoc_wpa_ie; /* Own WPA/RSN IE from (Re)AssocReq */ u8 *assoc_wpa_ie; /* Own WPA/RSN IE from (Re)AssocReq */
size_t assoc_wpa_ie_len; size_t assoc_wpa_ie_len;

View file

@ -223,6 +223,8 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
if (sm->mfp == 2) if (sm->mfp == 2)
capab |= WPA_CAPABILITY_MFPR; capab |= WPA_CAPABILITY_MFPR;
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
if (sm->ocv)
capab |= WPA_CAPABILITY_OCVC;
WPA_PUT_LE16(pos, capab); WPA_PUT_LE16(pos, capab);
pos += 2; pos += 2;

View file

@ -1511,6 +1511,9 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_MFP, wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_MFP,
wpas_get_ssid_pmf(wpa_s, ssid)); wpas_get_ssid_pmf(wpa_s, ssid));
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_OCV
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_OCV, ssid->ocv);
#endif /* CONFIG_OCV */
if (wpa_sm_set_assoc_wpa_ie_default(wpa_s->wpa, wpa_ie, wpa_ie_len)) { if (wpa_sm_set_assoc_wpa_ie_default(wpa_s->wpa, wpa_ie, wpa_ie_len)) {
wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to generate WPA IE"); wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to generate WPA IE");