From 68422fedbf1d2be71f726b6a2a90fae510e513ee Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 1 May 2020 19:52:31 +0300 Subject: [PATCH] DPP2: Parse DPP KDE in EAPOL-Key Key Data field Signed-off-by: Jouni Malinen --- src/common/wpa_common.c | 9 +++++++++ src/common/wpa_common.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c index eb1861a87..bddc696cf 100644 --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c @@ -2801,6 +2801,15 @@ static int wpa_parse_generic(const u8 *pos, struct wpa_eapol_ie_parse *ie) return 0; } + if (pos[1] >= RSN_SELECTOR_LEN + 2 && + RSN_SELECTOR_GET(pos + 2) == WFA_KEY_DATA_DPP) { + ie->dpp_kde = pos + 2 + RSN_SELECTOR_LEN; + ie->dpp_kde_len = pos[1] - RSN_SELECTOR_LEN; + wpa_hexdump(MSG_DEBUG, "WPA: DPP KDE in EAPOL-Key", + pos, pos[1] + 2); + return 0; + } + return 2; } diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h index 9ad9edc73..065dc7113 100644 --- a/src/common/wpa_common.h +++ b/src/common/wpa_common.h @@ -533,6 +533,8 @@ struct wpa_eapol_ie_parse { const u8 *ip_addr_alloc; const u8 *transition_disable; size_t transition_disable_len; + const u8 *dpp_kde; + size_t dpp_kde_len; const u8 *oci; size_t oci_len; const u8 *osen;