const u8 *rsne;
size_t rsne_len;
- if (elems.rsne_override_2 && wpas_rsn_overriding(wpa_s)) {
+ if (elems.rsne_override_2 && wpas_rsn_overriding(wpa_s, ssid)) {
rsne = elems.rsne_override_2;
rsne_len = elems.rsne_override_2_len;
} else if (elems.rsne_override &&
- wpas_rsn_overriding(wpa_s)) {
+ wpas_rsn_overriding(wpa_s, ssid)) {
rsne = elems.rsne_override;
rsne_len = elems.rsne_override_len;
} else {
{
const u8 *ie;
- if (wpas_rsn_overriding(wpa_s)) {
+ if (wpas_rsn_overriding(wpa_s, ssid)) {
if (!ssid)
ssid = wpa_s->current_ssid;
{
const u8 *ie;
- if (wpas_rsn_overriding(wpa_s)) {
+ if (wpas_rsn_overriding(wpa_s, ssid)) {
ie = wpa_bss_get_vendor_ie(bss, RSNXE_OVERRIDE_IE_VENDOR_TYPE);
if (ie) {
const u8 *tmp;
{ INT_RANGE(enable_4addr_mode, 0, 1)},
{ INT_RANGE(max_idle, 0, 65535)},
{ INT_RANGE(ssid_protection, 0, 1)},
+ { INT_RANGE(rsn_overriding, 0, 2)},
};
#undef OFFSET
#endif /* CONFIG_MACSEC */
ssid->mac_addr = WPAS_MAC_ADDR_STYLE_NOT_SET;
ssid->max_oper_chwidth = DEFAULT_MAX_OPER_CHWIDTH;
+ ssid->rsn_overriding = RSN_OVERRIDING_NOT_SET;
}
int wowlan_disconnect_on_deinit;
/**
- * rsn_overriding - RSN overriding
- *
- * 0 = Disabled
- * 1 = Enabled automatically if the driver indicates support
- * 2 = Forced to be enabled even without driver capability indication
+ * rsn_overriding - RSN overriding (default behavior)
*/
- enum rsn_overriding {
- RSN_OVERRIDING_DISABLED = 0,
- RSN_OVERRIDING_AUTO = 1,
- RSN_OVERRIDING_ENABLED = 2,
- } rsn_overriding;
+ enum wpas_rsn_overriding rsn_overriding;
#ifdef CONFIG_PASN
#ifdef CONFIG_TESTING_OPTIONS
INT(enable_4addr_mode);
INT(max_idle);
INT(ssid_protection);
+ INT_DEF(rsn_overriding, RSN_OVERRIDING_NOT_SET);
#undef STR
#undef INT
WPAS_MAC_ADDR_STYLE_DEDICATED_PER_ESS = 3,
};
+/**
+ * rsn_overriding - RSN overriding
+ *
+ * 0 = Disabled
+ * 1 = Enabled automatically if the driver indicates support
+ * 2 = Forced to be enabled even without driver capability indication
+ */
+enum wpas_rsn_overriding {
+ RSN_OVERRIDING_NOT_SET = -1,
+ RSN_OVERRIDING_DISABLED = 0,
+ RSN_OVERRIDING_AUTO = 1,
+ RSN_OVERRIDING_ENABLED = 2,
+};
+
/**
* struct wpa_ssid - Network configuration data
*
* ssid_protection - Whether to use SSID protection in 4-way handshake
*/
bool ssid_protection;
+
+ /**
+ * rsn_overriding - RSN overriding (per-network override for the global
+ * parameter with the same name)
+ */
+ enum wpas_rsn_overriding rsn_overriding;
};
#endif /* CONFIG_SSID_H */
}
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_RSN_OVERRIDE_SUPPORT,
- wpas_rsn_overriding(wpa_s));
+ wpas_rsn_overriding(wpa_s, ssid));
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_RSN_OVERRIDE,
RSN_OVERRIDE_NOT_USED);
- if (wpas_rsn_overriding(wpa_s) &&
+ if (wpas_rsn_overriding(wpa_s, ssid) &&
wpas_ap_supports_rsn_overriding(wpa_s, wpa_s->current_bss) &&
wpa_s->sme.assoc_req_ie_len + 2 + 4 <=
sizeof(wpa_s->sme.assoc_req_ie)) {
}
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_RSN_OVERRIDE_SUPPORT,
- wpas_rsn_overriding(wpa_s));
+ wpas_rsn_overriding(wpa_s, ssid));
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_RSN_OVERRIDE,
RSN_OVERRIDE_NOT_USED);
- if (wpas_rsn_overriding(wpa_s) &&
+ if (wpas_rsn_overriding(wpa_s, ssid) &&
wpas_ap_supports_rsn_overriding(wpa_s, bss) &&
wpa_ie_len + 2 + 4 + 1 <= max_wpa_ie_len) {
u8 *pos = wpa_ie + wpa_ie_len, *start = pos;
wpa_ie_len += pos - start;
}
- params->rsn_overriding = wpas_rsn_overriding(wpa_s);
+ params->rsn_overriding = wpas_rsn_overriding(wpa_s, ssid);
params->wpa_ie = wpa_ie;
params->wpa_ie_len = wpa_ie_len;
params->auth_alg = algs;
}
-bool wpas_rsn_overriding(struct wpa_supplicant *wpa_s)
+bool wpas_rsn_overriding(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
{
- if (wpa_s->conf->rsn_overriding == RSN_OVERRIDING_DISABLED)
+ enum wpas_rsn_overriding rsno;
+
+ if (ssid && ssid->rsn_overriding != RSN_OVERRIDING_NOT_SET)
+ rsno = ssid->rsn_overriding;
+ else
+ rsno = wpa_s->conf->rsn_overriding;
+
+ if (rsno == RSN_OVERRIDING_DISABLED)
return false;
- if (wpa_s->conf->rsn_overriding == RSN_OVERRIDING_ENABLED)
+ if (rsno == RSN_OVERRIDING_ENABLED)
return true;
if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) ||
# NOTE: The protocol used for this mechanism is still subject to change and as
# such, this should not yet be enabled for production uses to avoid issues if
# something were to change.
+# A per-network block parameter with the same name can be used to override this
+# global parameter.
# 0 = Disabled (default)
# 1 = Enabled automatically if the driver indicates support
# 2 = Forced to be enabled even without driver capability indication
void fils_connection_failure(struct wpa_supplicant *wpa_s);
void fils_pmksa_cache_flush(struct wpa_supplicant *wpa_s);
int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
-bool wpas_rsn_overriding(struct wpa_supplicant *wpa_s);
+bool wpas_rsn_overriding(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
void wpas_auth_failed(struct wpa_supplicant *wpa_s, const char *reason,
const u8 *bssid);