sm->ctx->notify_pmksa_cache_entry(sm->ctx->ctx, entry);
}
+static inline void wpa_sm_ssid_verified(struct wpa_sm *sm)
+{
+ if (sm->ctx->ssid_verified)
+ sm->ctx->ssid_verified(sm->ctx->ctx);
+}
+
int wpa_eapol_key_send(struct wpa_sm *sm, struct wpa_ptk *ptk,
int ver, const u8 *dest, u16 proto,
u8 *msg, size_t msg_len, u8 *key_mic);
#ifdef CONFIG_SME
wpa_s->sme.bss_max_idle_period = 0;
#endif /* CONFIG_SME */
+
+ wpa_s->ssid_verified = false;
}
bool bssid_known;
wpa_dbg(wpa_s, MSG_DEBUG, "Association info event");
+ wpa_s->ssid_verified = false;
+#ifdef CONFIG_SAE
+#ifdef CONFIG_SME
+ /* SAE H2E binds the SSID into PT and that verifies the SSID
+ * implicitly. */
+ if (wpa_s->sme.sae.state == SAE_ACCEPTED && wpa_s->sme.sae.h2e)
+ wpa_s->ssid_verified = true;
+#endif /* CONFIG_SME */
+#endif /* CONFIG_SAE */
bssid_known = wpa_drv_get_bssid(wpa_s, bssid) == 0;
if (data->assoc_info.req_ies)
wpa_hexdump(MSG_DEBUG, "req_ies", data->assoc_info.req_ies,
#ifdef CONFIG_FILS
#ifdef CONFIG_SME
- if ((wpa_s->sme.auth_alg == WPA_AUTH_ALG_FILS ||
- wpa_s->sme.auth_alg == WPA_AUTH_ALG_FILS_SK_PFS) &&
- (!data->assoc_info.resp_frame ||
- fils_process_assoc_resp(wpa_s->wpa,
- data->assoc_info.resp_frame,
- data->assoc_info.resp_frame_len) < 0)) {
- wpa_supplicant_deauthenticate(wpa_s, WLAN_REASON_UNSPECIFIED);
- return -1;
+ if (wpa_s->sme.auth_alg == WPA_AUTH_ALG_FILS ||
+ wpa_s->sme.auth_alg == WPA_AUTH_ALG_FILS_SK_PFS) {
+ if (!data->assoc_info.resp_frame ||
+ fils_process_assoc_resp(wpa_s->wpa,
+ data->assoc_info.resp_frame,
+ data->assoc_info.resp_frame_len) <
+ 0) {
+ wpa_supplicant_deauthenticate(wpa_s,
+ WLAN_REASON_UNSPECIFIED);
+ return -1;
+ }
+
+ /* FILS use of an AEAD cipher include the SSID element in
+ * (Re)Association Request frame in the AAD and since the AP
+ * accepted that, the SSID was verified. */
+ wpa_s->ssid_verified = true;
}
#endif /* CONFIG_SME */
wpa_s, WLAN_REASON_INVALID_IE);
return -1;
}
+ /* SSID is included in PMK-R0 derivation, so it is verified
+ * implicitly. */
+ wpa_s->ssid_verified = true;
}
p = data->assoc_info.resp_ies;
return -1;
}
wpa_dbg(wpa_s, MSG_DEBUG, "FT: Reassociation Response done");
+ /* SSID is included in PMK-R0 derivation, so it is verified
+ * implicitly. */
+ wpa_s->ssid_verified = true;
}
wpa_sm_set_ft_params(wpa_s->wpa, data->assoc_info.resp_ies,
}
+static void wpa_supplicant_ssid_verified(void *_wpa_s)
+{
+ struct wpa_supplicant *wpa_s = _wpa_s;
+
+ wpa_s->ssid_verified = true;
+ wpa_msg(wpa_s, MSG_INFO, "RSN: SSID matched expected value");
+}
+
+
int wpa_supplicant_init_wpa(struct wpa_supplicant *wpa_s)
{
#ifndef CONFIG_NO_WPA
ctx->set_ltf_keyseed = wpa_supplicant_set_ltf_keyseed;
#endif /* CONFIG_PASN */
ctx->notify_pmksa_cache_entry = wpa_supplicant_notify_pmksa_cache_entry;
+ ctx->ssid_verified = wpa_supplicant_ssid_verified;
wpa_s->wpa = wpa_sm_init(ctx);
if (wpa_s->wpa == NULL) {