FT: Fix FTIE generation for EAPOL-Key msg 3/4

This FTIE needs to be an exact copy of the one in (Re)Association
Response frame. Copy the stored element rather than building a new copy
that would not have the correct MIC value. This is needed to fix PTK
rekeying after FT protocol run.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-12-10 00:12:59 +02:00 committed by Jouni Malinen
parent e44bd28cd1
commit 9257610a6e

View file

@ -2328,10 +2328,18 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
struct wpa_auth_config *conf; struct wpa_auth_config *conf;
conf = &sm->wpa_auth->conf; conf = &sm->wpa_auth->conf;
res = wpa_write_ftie(conf, conf->r0_key_holder, if (sm->assoc_resp_ftie &&
conf->r0_key_holder_len, kde + kde_len - pos >= 2 + sm->assoc_resp_ftie[1]) {
NULL, NULL, pos, kde + kde_len - pos, os_memcpy(pos, sm->assoc_resp_ftie,
NULL, 0); 2 + sm->assoc_resp_ftie[1]);
res = 2 + sm->assoc_resp_ftie[1];
} else {
res = wpa_write_ftie(conf, conf->r0_key_holder,
conf->r0_key_holder_len,
NULL, NULL, pos,
kde + kde_len - pos,
NULL, 0);
}
if (res < 0) { if (res < 0) {
wpa_printf(MSG_ERROR, "FT: Failed to insert FTIE " wpa_printf(MSG_ERROR, "FT: Failed to insert FTIE "
"into EAPOL-Key Key Data"); "into EAPOL-Key Key Data");