aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorAshok Ponnaiah <aponnaia@codeaurora.org>2018-11-30 15:26:26 (GMT)
committerJouni Malinen <j@w1.fi>2018-11-30 15:26:26 (GMT)
commitfcb3f11e4d536ca6e7f297db488394ed843bb753 (patch)
tree028c05e76a4a62ee8e4dde7ad178292c121f9161 /wpa_supplicant/sme.c
parent77e4f012f111730c8e602c55cfe9ff6051975388 (diff)
downloadhostap-fcb3f11e4d536ca6e7f297db488394ed843bb753.zip
hostap-fcb3f11e4d536ca6e7f297db488394ed843bb753.tar.gz
hostap-fcb3f11e4d536ca6e7f297db488394ed843bb753.tar.bz2
SAE: Fix external authentication on big endian platforms
Need to handle the little endian 16-bit fields properly when building and parsing Authentication frames. Fixes: 5ff39c1380d9 ("SAE: Support external authentication offload for driver-SME cases") Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index a7e3bf2..ccc2064 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -895,10 +895,10 @@ static int sme_external_auth_build_buf(struct wpabuf *buf,
os_memcpy(resp->da, da, ETH_ALEN);
os_memcpy(resp->sa, sa, ETH_ALEN);
os_memcpy(resp->bssid, da, ETH_ALEN);
- resp->u.auth.auth_alg = WLAN_AUTH_SAE;
- resp->seq_ctrl = seq_num << 4;
- resp->u.auth.auth_transaction = auth_transaction;
- resp->u.auth.status_code = WLAN_STATUS_SUCCESS;
+ resp->u.auth.auth_alg = host_to_le16(WLAN_AUTH_SAE);
+ resp->seq_ctrl = host_to_le16(seq_num << 4);
+ resp->u.auth.auth_transaction = host_to_le16(auth_transaction);
+ resp->u.auth.status_code = host_to_le16(WLAN_STATUS_SUCCESS);
if (params)
wpabuf_put_buf(buf, params);
@@ -1178,13 +1178,14 @@ void sme_external_auth_mgmt_rx(struct wpa_supplicant *wpa_s,
return;
}
- if (header->u.auth.auth_alg == WLAN_AUTH_SAE) {
+ if (le_to_host16(header->u.auth.auth_alg) == WLAN_AUTH_SAE) {
int res;
- res = sme_sae_auth(wpa_s, header->u.auth.auth_transaction,
- header->u.auth.status_code,
- header->u.auth.variable,
- len - auth_length, 1, header->sa);
+ res = sme_sae_auth(
+ wpa_s, le_to_host16(header->u.auth.auth_transaction),
+ le_to_host16(header->u.auth.status_code),
+ header->u.auth.variable,
+ len - auth_length, 1, header->sa);
if (res < 0) {
/* Notify failure to the driver */
sme_send_external_auth_status(