]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add parsing of Key ID KDE for Extended Key ID
authorAlexander Wetzel <alexander@wetzel-home.de>
Sun, 15 Mar 2020 19:04:20 +0000 (20:04 +0100)
committerJouni Malinen <j@w1.fi>
Sun, 15 Mar 2020 21:17:56 +0000 (23:17 +0200)
wpa_parse_generic() can now recognize the Key ID KDE that will be needed
to deliver the Key ID of the pairwise key when Extended Key ID is used.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
src/common/wpa_common.c
src/common/wpa_common.h

index c63d7bce1a0c319fb2c1b8c4701758d223ba4249..e8a4a2beb919dcc7493281b99578358a5366e075 100644 (file)
@@ -2717,6 +2717,14 @@ static int wpa_parse_generic(const u8 *pos, const u8 *end,
                return 0;
        }
 
+       if (pos[1] >= RSN_SELECTOR_LEN + 2 &&
+           RSN_SELECTOR_GET(pos + 2) == RSN_KEY_DATA_KEYID) {
+               ie->key_id = pos + 2 + RSN_SELECTOR_LEN;
+               wpa_hexdump(MSG_DEBUG, "WPA: KeyID in EAPOL-Key",
+                           pos, pos[1] + 2);
+               return 0;
+       }
+
        if (pos[1] > RSN_SELECTOR_LEN + 2 &&
            RSN_SELECTOR_GET(pos + 2) == RSN_KEY_DATA_GROUPKEY) {
                ie->gtk = pos + 2 + RSN_SELECTOR_LEN;
index 7850c878efa91ca056aedbb8ef2b67dfecb277e7..1a9a4105f168cabde3772963d9d408be67d30734 100644 (file)
@@ -494,6 +494,7 @@ struct wpa_eapol_ie_parse {
        const u8 *rsn_ie;
        size_t rsn_ie_len;
        const u8 *pmkid;
+       const u8 *key_id;
        const u8 *gtk;
        size_t gtk_len;
        const u8 *mac_addr;