]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Basic Extended Key ID support
authorAlexander Wetzel <alexander@wetzel-home.de>
Sun, 15 Mar 2020 19:04:25 +0000 (20:04 +0100)
committerJouni Malinen <j@w1.fi>
Sun, 15 Mar 2020 22:07:20 +0000 (00:07 +0200)
Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
wlantest/bss.c
wlantest/rx_data.c
wlantest/rx_eapol.c

index 0556c72e2f37da6e8a4bdc7a0425866a4ee795c0..3208e65e4195d5b69aafca51e4d2e6586aedc3e8 100644 (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"
                   "mgmt_group_cipher=%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),
                   bss->proto == 0 ? "OPEN " : "",
                   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_PEERKEY_ENABLED ?
                   "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 " : "");
 }
 
 
index d86a5886c3bc5db5d91916336cc201c65575e9b6..1ee25a645248596fc2a7455ed6d6c89a2130f1f7 100644 (file)
@@ -466,9 +466,13 @@ static void rx_data_bss_prot(struct wlantest *wt,
        }
 
        keyid = data[3] >> 6;
-       if (keyid != 0) {
-               add_note(wt, MSG_INFO, "Unexpected non-zero KeyID %d in "
-                        "individually addressed Data frame from " MACSTR,
+       if (keyid != 0 &&
+           (!(sta->rsn_capab & WPA_CAPABILITY_EXT_KEY_ID_FOR_UNICAST) ||
+            !(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));
        }
 
index 2e49929c1913f73c207841fad42975fe8edcad33..1cfdf8e9e85961b553008cba6805c279f4261b7e 100644 (file)
@@ -464,6 +464,9 @@ static void learn_kde_keys(struct wlantest *wt, struct wlantest_bss *bss,
                            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) {
                wpa_hexdump(MSG_MSGDUMP, "EAPOL-Key Key Data - GTK KDE",
                            ie.gtk, ie.gtk_len);