|
|
|
@ -118,12 +118,12 @@ static inline const u8 * wpa_auth_get_psk(struct wpa_authenticator *wpa_auth,
|
|
|
|
|
const u8 *addr,
|
|
|
|
|
const u8 *p2p_dev_addr,
|
|
|
|
|
const u8 *prev_psk, size_t *psk_len,
|
|
|
|
|
int *vlan_id)
|
|
|
|
|
struct vlan_description *vlan_desc)
|
|
|
|
|
{
|
|
|
|
|
if (!wpa_auth->cb->get_psk)
|
|
|
|
|
return NULL;
|
|
|
|
|
return wpa_auth->cb->get_psk(wpa_auth->cb_ctx, addr, p2p_dev_addr,
|
|
|
|
|
prev_psk, psk_len, vlan_id);
|
|
|
|
|
prev_psk, psk_len, vlan_desc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -298,11 +298,12 @@ static int wpa_channel_info(struct wpa_authenticator *wpa_auth,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int wpa_auth_update_vlan(struct wpa_authenticator *wpa_auth,
|
|
|
|
|
const u8 *addr, int vlan_id)
|
|
|
|
|
const u8 *addr,
|
|
|
|
|
struct vlan_description *vlan_desc)
|
|
|
|
|
{
|
|
|
|
|
if (!wpa_auth->cb->update_vlan)
|
|
|
|
|
return -1;
|
|
|
|
|
return wpa_auth->cb->update_vlan(wpa_auth->cb_ctx, addr, vlan_id);
|
|
|
|
|
return wpa_auth->cb->update_vlan(wpa_auth->cb_ctx, addr, vlan_desc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -937,15 +938,16 @@ static int wpa_try_alt_snonce(struct wpa_state_machine *sm, u8 *data,
|
|
|
|
|
int ok = 0;
|
|
|
|
|
const u8 *pmk = NULL;
|
|
|
|
|
size_t pmk_len;
|
|
|
|
|
int vlan_id = 0;
|
|
|
|
|
struct vlan_description vlan_desc;
|
|
|
|
|
|
|
|
|
|
os_memset(&vlan_desc, 0, sizeof(vlan_desc));
|
|
|
|
|
os_memset(&PTK, 0, sizeof(PTK));
|
|
|
|
|
for (;;) {
|
|
|
|
|
if (wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt) &&
|
|
|
|
|
!wpa_key_mgmt_sae(sm->wpa_key_mgmt)) {
|
|
|
|
|
pmk = wpa_auth_get_psk(sm->wpa_auth, sm->addr,
|
|
|
|
|
sm->p2p_dev_addr, pmk, &pmk_len,
|
|
|
|
|
&vlan_id);
|
|
|
|
|
&vlan_desc);
|
|
|
|
|
if (!pmk)
|
|
|
|
|
break;
|
|
|
|
|
#ifdef CONFIG_IEEE80211R_AP
|
|
|
|
@ -988,8 +990,8 @@ static int wpa_try_alt_snonce(struct wpa_state_machine *sm, u8 *data,
|
|
|
|
|
"WPA: Earlier SNonce resulted in matching MIC");
|
|
|
|
|
sm->alt_snonce_valid = 0;
|
|
|
|
|
|
|
|
|
|
if (vlan_id && wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt) &&
|
|
|
|
|
wpa_auth_update_vlan(sm->wpa_auth, sm->addr, vlan_id) < 0)
|
|
|
|
|
if (vlan_desc.notempty && wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt) &&
|
|
|
|
|
wpa_auth_update_vlan(sm->wpa_auth, sm->addr, &vlan_desc) < 0)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
os_memcpy(sm->SNonce, sm->alt_SNonce, WPA_NONCE_LEN);
|
|
|
|
@ -2938,9 +2940,11 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
|
|
|
|
|
struct ieee802_1x_hdr *hdr;
|
|
|
|
|
struct wpa_eapol_key *key;
|
|
|
|
|
struct wpa_eapol_ie_parse kde;
|
|
|
|
|
int vlan_id = 0;
|
|
|
|
|
struct vlan_description vlan_desc;
|
|
|
|
|
int owe_ptk_workaround = !!wpa_auth->conf.owe_ptk_workaround;
|
|
|
|
|
|
|
|
|
|
os_memset(&vlan_desc, 0, sizeof(vlan_desc));
|
|
|
|
|
|
|
|
|
|
SM_ENTRY_MA(WPA_PTK, PTKCALCNEGOTIATING, wpa_ptk);
|
|
|
|
|
sm->EAPOLKeyReceived = false;
|
|
|
|
|
sm->update_snonce = false;
|
|
|
|
@ -2956,7 +2960,7 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
|
|
|
|
|
!wpa_key_mgmt_sae(sm->wpa_key_mgmt)) {
|
|
|
|
|
pmk = wpa_auth_get_psk(sm->wpa_auth, sm->addr,
|
|
|
|
|
sm->p2p_dev_addr, pmk, &pmk_len,
|
|
|
|
|
&vlan_id);
|
|
|
|
|
&vlan_desc);
|
|
|
|
|
if (!pmk)
|
|
|
|
|
break;
|
|
|
|
|
psk_found = 1;
|
|
|
|
@ -3086,6 +3090,7 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
|
|
|
|
|
WLAN_REASON_PREV_AUTH_NOT_VALID);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_OCV
|
|
|
|
|
if (wpa_auth_uses_ocv(sm)) {
|
|
|
|
|
struct wpa_channel_info ci;
|
|
|
|
@ -3189,8 +3194,8 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
|
|
|
|
|
}
|
|
|
|
|
#endif /* CONFIG_IEEE80211R_AP */
|
|
|
|
|
|
|
|
|
|
if (vlan_id && wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt) &&
|
|
|
|
|
wpa_auth_update_vlan(wpa_auth, sm->addr, vlan_id) < 0) {
|
|
|
|
|
if (vlan_desc.notempty && wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt) &&
|
|
|
|
|
wpa_auth_update_vlan(wpa_auth, sm->addr, &vlan_desc) < 0) {
|
|
|
|
|
wpa_sta_disconnect(wpa_auth, sm->addr,
|
|
|
|
|
WLAN_REASON_PREV_AUTH_NOT_VALID);
|
|
|
|
|
return;
|
|
|
|
|