From e0b331d896cb4e8bac6b02159910a4bd4a6d090d Mon Sep 17 00:00:00 2001 From: Sunil Dutt Date: Thu, 25 Jul 2019 12:10:57 +0530 Subject: [PATCH] OWE: Update connect params with new DH attributes to the driver A new DH public key is sent through this interface to the driver after every successful connection/roam to a BSS. This helps to do OWE roaming to a new BSS with drivers that implement SME/MLME operations during roaming. This updated DH IEs are added in the subsequent (Re)Association Request frame sent by the station when roaming. The DH IE from the roamed AP is given to wpa_supplicant in the roam result event. wpa_supplicant shall further process these DH IEs to generate the PMK for the 4-way handshake. Signed-off-by: Jouni Malinen --- wpa_supplicant/wpa_supplicant.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index d536be0a6..e7a24fc9c 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -125,6 +125,9 @@ static void wpa_bss_tmp_disallow_timeout(void *eloop_ctx, void *timeout_ctx); #if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL) static void wpas_update_fils_connect_params(struct wpa_supplicant *wpa_s); #endif /* CONFIG_FILS && IEEE8021X_EAPOL */ +#ifdef CONFIG_OWE +static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s); +#endif /* CONFIG_OWE */ /* Configure default/group WEP keys for static WEP */ @@ -944,6 +947,10 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, if (!fils_hlp_sent && ssid && ssid->eap.erp) wpas_update_fils_connect_params(wpa_s); #endif /* CONFIG_FILS && IEEE8021X_EAPOL */ +#ifdef CONFIG_OWE + if (ssid && (ssid->key_mgmt & WPA_KEY_MGMT_OWE)) + wpas_update_owe_connect_params(wpa_s); +#endif /* CONFIG_OWE */ } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || state == WPA_ASSOCIATED) { wpa_s->new_connection = 1; @@ -2964,6 +2971,24 @@ pfs_fail: } +#ifdef CONFIG_OWE +static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s) +{ + struct wpa_driver_associate_params params; + u8 *wpa_ie; + + os_memset(¶ms, 0, sizeof(params)); + wpa_ie = wpas_populate_assoc_ies(wpa_s, wpa_s->current_bss, + wpa_s->current_ssid, ¶ms, NULL); + if (!wpa_ie) + return; + + wpa_drv_update_connect_params(wpa_s, ¶ms, WPA_DRV_UPDATE_ASSOC_IES); + os_free(wpa_ie); +} +#endif /* CONFIG_OWE */ + + #if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL) static void wpas_update_fils_connect_params(struct wpa_supplicant *wpa_s) { -- 2.39.2