wlantest: Basic Extended Key ID support

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
This commit is contained in:
Alexander Wetzel 2020-03-15 20:04:25 +01:00 committed by Jouni Malinen
parent 796253a65f
commit 6ea7a152c6
3 changed files with 14 additions and 5 deletions

View file

@ -290,7 +290,7 @@ void bss_update(struct wlantest *wt, struct wlantest_bss *bss,
"group=%s%s%s%s%s%s%s%s%s" "group=%s%s%s%s%s%s%s%s%s"
"mgmt_group_cipher=%s%s%s%s%s" "mgmt_group_cipher=%s%s%s%s%s"
"key_mgmt=%s%s%s%s%s%s%s%s%s" "key_mgmt=%s%s%s%s%s%s%s%s%s"
"rsn_capab=%s%s%s%s%s%s", "rsn_capab=%s%s%s%s%s%s%s",
MAC2STR(bss->bssid), MAC2STR(bss->bssid),
bss->proto == 0 ? "OPEN " : "", bss->proto == 0 ? "OPEN " : "",
bss->proto & WPA_PROTO_WPA ? "WPA " : "", bss->proto & WPA_PROTO_WPA ? "WPA " : "",
@ -341,7 +341,9 @@ void bss_update(struct wlantest *wt, struct wlantest_bss *bss,
bss->rsn_capab & WPA_CAPABILITY_MFPC ? "MFPC " : "", bss->rsn_capab & WPA_CAPABILITY_MFPC ? "MFPC " : "",
bss->rsn_capab & WPA_CAPABILITY_PEERKEY_ENABLED ? bss->rsn_capab & WPA_CAPABILITY_PEERKEY_ENABLED ?
"PEERKEY " : "", "PEERKEY " : "",
bss->rsn_capab & WPA_CAPABILITY_OCVC ? "OCVC " : ""); bss->rsn_capab & WPA_CAPABILITY_OCVC ? "OCVC " : "",
bss->rsn_capab & WPA_CAPABILITY_EXT_KEY_ID_FOR_UNICAST ?
"ExtKeyID " : "");
} }

View file

@ -466,9 +466,13 @@ static void rx_data_bss_prot(struct wlantest *wt,
} }
keyid = data[3] >> 6; keyid = data[3] >> 6;
if (keyid != 0) { if (keyid != 0 &&
add_note(wt, MSG_INFO, "Unexpected non-zero KeyID %d in " (!(sta->rsn_capab & WPA_CAPABILITY_EXT_KEY_ID_FOR_UNICAST) ||
"individually addressed Data frame from " MACSTR, !(bss->rsn_capab & WPA_CAPABILITY_EXT_KEY_ID_FOR_UNICAST) ||
keyid != 1)) {
add_note(wt, MSG_INFO,
"Unexpected KeyID %d in individually addressed Data frame from "
MACSTR,
keyid, MAC2STR(hdr->addr2)); keyid, MAC2STR(hdr->addr2));
} }

View file

@ -464,6 +464,9 @@ static void learn_kde_keys(struct wlantest *wt, struct wlantest_bss *bss,
ie.rsn_ie, ie.rsn_ie_len); ie.rsn_ie, ie.rsn_ie_len);
} }
if (ie.key_id)
add_note(wt, MSG_DEBUG, "KeyID %u", ie.key_id[0]);
if (ie.gtk) { if (ie.gtk) {
wpa_hexdump(MSG_MSGDUMP, "EAPOL-Key Key Data - GTK KDE", wpa_hexdump(MSG_MSGDUMP, "EAPOL-Key Key Data - GTK KDE",
ie.gtk, ie.gtk_len); ie.gtk, ie.gtk_len);