OWE: Add AP mode handling of OWE with drivers that implement SME

Handle OWE DH exchange and key setup when processing the association
event from a driver that implements AP SME.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Ashok Kumar Ponnaiah 2017-10-30 23:24:42 +02:00 committed by Jouni Malinen
parent 28d1264131
commit 33c8bbd8ca
3 changed files with 47 additions and 1 deletions

View file

@ -520,7 +520,19 @@ skip_wpa_check:
}
#endif /* CONFIG_FILS */
#if defined(CONFIG_IEEE80211R_AP) || defined(CONFIG_FILS)
#ifdef CONFIG_OWE
if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) &&
wpa_auth_sta_key_mgmt(sta->wpa_sm) == WPA_KEY_MGMT_OWE &&
elems.owe_dh) {
p = owe_auth_req_process(hapd, sta,
elems.owe_dh, elems.owe_dh_len,
p, &reason);
if (!p || reason != WLAN_STATUS_SUCCESS)
goto fail;
}
#endif /* CONFIG_OWE */
#if defined(CONFIG_IEEE80211R_AP) || defined(CONFIG_FILS) || defined(CONFIG_OWE)
hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf);
if (sta->auth_alg == WLAN_AUTH_FT ||

View file

@ -2932,6 +2932,37 @@ done:
}
#ifdef CONFIG_OWE
u8 * owe_auth_req_process(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *owe_dh, u8 owe_dh_len,
u8 *owe_buf, u16 *reason)
{
struct wpabuf *pub;
*reason = owe_process_assoc_req(hapd, sta, owe_dh, owe_dh_len);
if (*reason != WLAN_STATUS_SUCCESS)
return NULL;
pub = crypto_ecdh_get_pubkey(sta->owe_ecdh, 0);
if (!pub) {
*reason = WLAN_STATUS_UNSPECIFIED_FAILURE;
return NULL;
}
/* OWE Diffie-Hellman Parameter element */
*owe_buf++ = WLAN_EID_EXTENSION; /* Element ID */
*owe_buf++ = 1 + 2 + wpabuf_len(pub); /* Length */
*owe_buf++ = WLAN_EID_EXT_OWE_DH_PARAM; /* Element ID Extension */
WPA_PUT_LE16(owe_buf, OWE_DH_GROUP);
owe_buf += 2;
os_memcpy(owe_buf, wpabuf_head(pub), wpabuf_len(pub));
owe_buf += wpabuf_len(pub);
wpabuf_free(pub);
*reason = WLAN_STATUS_SUCCESS;
return owe_buf;
}
#endif /* CONFIG_OWE */
#ifdef CONFIG_FILS
void fils_hlp_finish_assoc(struct hostapd_data *hapd, struct sta_info *sta)

View file

@ -142,6 +142,9 @@ void ieee802_11_finish_fils_auth(struct hostapd_data *hapd,
struct sta_info *sta, int success,
struct wpabuf *erp_resp,
const u8 *msk, size_t msk_len);
u8 * owe_auth_req_process(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *owe_dh, u8 owe_dh_len,
u8 *owe_buf, u16 *reason);
void fils_hlp_timeout(void *eloop_ctx, void *eloop_data);
void fils_hlp_finish_assoc(struct hostapd_data *hapd, struct sta_info *sta);
void handle_auth_fils(struct hostapd_data *hapd, struct sta_info *sta,