From 34755e9209567a834776c9f3f5a02ba8e146331b Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Tue, 2 Jul 2019 00:13:49 +0200 Subject: [PATCH] supplicant: use separate flag for 4-way handshake offload Commit d896874f8689 ("nl80211: Indicate 802.1X 4-way handshake offload in connect") used the req_key_mgmt_offload flag to indicate to the driver that it should offload the 802.1X handshake. However, this field was existing and used for a different offload API. This causes wpa_supplicant to send a connect request with the WANT_1X_HS flag and the subsequent set-pmk is rejected causing the connection to fail. So this patch fixes that by introducing a new flag req_handshake_offload so the offloads are no longer entangled. Reported-by: Stefan Wahren Tested-by: Stefan Wahren Signed-off-by: Arend van Spriel --- src/drivers/driver.h | 8 ++++++++ src/drivers/driver_nl80211.c | 2 +- wpa_supplicant/wpa_supplicant.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index e7c8f318f..8d544badf 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1045,6 +1045,14 @@ struct wpa_driver_associate_params { */ int req_key_mgmt_offload; + /** + * req_handshake_offload - Request EAPOL handshake offload + * + * Request EAPOL handshake offload for this connection if the device + * supports it. + */ + int req_handshake_offload; + /** * Flag for indicating whether this association includes support for * RRM (Radio Resource Measurements) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 54fe39000..987828c96 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5605,7 +5605,7 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv, return -1; } - if (params->req_key_mgmt_offload && + if (params->req_handshake_offload && (drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X)) { wpa_printf(MSG_DEBUG, " * WANT_1X_4WAY_HS"); if (nla_put_flag(msg, NL80211_ATTR_WANT_1X_4WAY_HS)) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 96a3691cf..a73db95f7 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -3220,7 +3220,7 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit) params.key_mgmt_suite == WPA_KEY_MGMT_IEEE8021X_SHA256 || params.key_mgmt_suite == WPA_KEY_MGMT_IEEE8021X_SUITE_B || params.key_mgmt_suite == WPA_KEY_MGMT_IEEE8021X_SUITE_B_192)) - params.req_key_mgmt_offload = 1; + params.req_handshake_offload = 1; if (wpa_s->conf->key_mgmt_offload) { if (params.key_mgmt_suite == WPA_KEY_MGMT_IEEE8021X || -- 2.22.0