FT: Set FT Capability and Policy properly in MDIE during initial MD assoc

This field needs to be copied from the scan results for the AP
per IEEE Std 802.11r-2008, 11A.4.2.
This commit is contained in:
Jouni Malinen 2010-04-09 16:41:57 +03:00 committed by Jouni Malinen
parent 76b7981d07
commit f4ec630d1b
3 changed files with 8 additions and 3 deletions

View File

@ -62,7 +62,7 @@ int wpa_derive_ptk_ft(struct wpa_sm *sm, const unsigned char *src_addr,
/**
* wpa_sm_set_ft_params - Set FT (IEEE 802.11r) parameters
* @sm: Pointer to WPA state machine data from wpa_sm_init()
* @mobility_domain: Mobility domain identifier (2 octets)
* @mobility_domain: Mobility domain identifier (2 octets + 1 octet)
* @r0kh_id: PMK-R0 key holder identity (1-48 octets)
* @r0kh_id_len: R0KH-ID length (1-48)
* @r1kh_id: PMK-R1 key holder identity (16 octets)
@ -77,6 +77,9 @@ int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *mobility_domain,
mobility_domain, MOBILITY_DOMAIN_ID_LEN);
os_memcpy(sm->mobility_domain, mobility_domain,
MOBILITY_DOMAIN_ID_LEN);
sm->mdie_ft_capab = mobility_domain[MOBILITY_DOMAIN_ID_LEN];
wpa_printf(MSG_DEBUG, "FT: Capability and Policy: 0x%02x",
sm->mdie_ft_capab);
} else if (sm)
os_memset(sm->mobility_domain, 0, MOBILITY_DOMAIN_ID_LEN);
@ -229,7 +232,8 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
pos += sizeof(*mdie);
os_memcpy(mdie->mobility_domain, sm->mobility_domain,
MOBILITY_DOMAIN_ID_LEN);
mdie->ft_capab = ap_mdie && ap_mdie[1] >= 3 ? ap_mdie[4] : 0;
mdie->ft_capab = ap_mdie && ap_mdie[1] >= 3 ? ap_mdie[4] :
sm->mdie_ft_capab;
/* FTIE[SNonce, [R1KH-ID,] R0KH-ID ] */
ftie_pos = pos;

View File

@ -108,6 +108,7 @@ struct wpa_sm {
int over_the_ds_in_progress;
u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
int set_ptk_after_assoc;
u8 mdie_ft_capab; /* FT Capability and Policy from target AP MDIE */
#endif /* CONFIG_IEEE80211R */
};

View File

@ -178,7 +178,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
mdie = (struct rsn_mdie *) pos;
os_memcpy(mdie->mobility_domain, md,
MOBILITY_DOMAIN_ID_LEN);
mdie->ft_capab = 0;
mdie->ft_capab = md[MOBILITY_DOMAIN_ID_LEN];
wpa_s->sme.assoc_req_ie_len += 5;
}