]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OCV: Advertise OCV capability in RSN capabilities (STA)
authorMathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
Mon, 6 Aug 2018 19:46:25 +0000 (15:46 -0400)
committerJouni Malinen <j@w1.fi>
Sun, 16 Dec 2018 18:49:27 +0000 (20:49 +0200)
Set the OCV bit in RSN capabilities (RSNE) based on station mode
configuration.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
src/rsn_supp/wpa.c
src/rsn_supp/wpa.h
src/rsn_supp/wpa_ft.c
src/rsn_supp/wpa_i.h
src/rsn_supp/wpa_ie.c
wpa_supplicant/wpa_supplicant.c

index e0c913074c631a49c85b852cb9ea83105b0363af..521f5a22073f08a6084b64e6852858e65170e084 100644 (file)
@@ -2864,6 +2864,9 @@ int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
        case WPA_PARAM_MFP:
                sm->mfp = value;
                break;
+       case WPA_PARAM_OCV:
+               sm->ocv = value;
+               break;
        default:
                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)
                capab |= WPA_CAPABILITY_MFPC;
 #endif /* CONFIG_IEEE80211W */
+       if (sm->ocv)
+               capab |= WPA_CAPABILITY_OCVC;
        wpabuf_put_le16(buf, capab);
 
        /* PMKID Count */
index d52b8e0334717f3a09cdcc406827b2949c28d134..b832267a51a7f9ed230f83fd326d216112579250 100644 (file)
@@ -97,7 +97,8 @@ enum wpa_sm_conf_params {
        WPA_PARAM_KEY_MGMT,
        WPA_PARAM_MGMT_GROUP,
        WPA_PARAM_RSN_ENABLED,
-       WPA_PARAM_MFP
+       WPA_PARAM_MFP,
+       WPA_PARAM_OCV
 };
 
 struct rsn_supp_config {
index b8d60e3208d096d91b795230ce6848c856d90b9c..9caff859dcea526b3cb7bdeef4d3c943dbd84e1b 100644 (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)
                capab |= WPA_CAPABILITY_MFPC;
 #endif /* CONFIG_IEEE80211W */
+       if (sm->ocv)
+               capab |= WPA_CAPABILITY_OCVC;
        WPA_PUT_LE16(pos, capab);
        pos += 2;
 
index 27619901d90438c24a779035452171f923cf4c81..e1a213bd1b2bcc61a7d9dcd91cce1405ac2d6283 100644 (file)
@@ -86,6 +86,7 @@ struct wpa_sm {
 
        int rsn_enabled; /* Whether RSN is enabled in configuration */
        int mfp; /* 0 = disabled, 1 = optional, 2 = mandatory */
+       int ocv; /* Operating Channel Validation */
 
        u8 *assoc_wpa_ie; /* Own WPA/RSN IE from (Re)AssocReq */
        size_t assoc_wpa_ie_len;
index a3410d15447a4306fb55d37bd99395b23a55503e..ea2e9267222e74860373e80c840a6eb9601e3b3b 100644 (file)
@@ -223,6 +223,8 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
        if (sm->mfp == 2)
                capab |= WPA_CAPABILITY_MFPR;
 #endif /* CONFIG_IEEE80211W */
+       if (sm->ocv)
+               capab |= WPA_CAPABILITY_OCVC;
        WPA_PUT_LE16(pos, capab);
        pos += 2;
 
index 59fb47c955962f1a7e6742fcaa49b7bff7d77837..bd66d9b599337cc93f0af487d55c04e9246b9c69 100644 (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,
                         wpas_get_ssid_pmf(wpa_s, ssid));
 #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)) {
                wpa_msg(wpa_s, MSG_WARNING, "WPA: Failed to generate WPA IE");