3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

handshake: Add handshake_util_find_pmkid_kde

Add a function that finds the PMKID kde in an RSNE's Key Data field
similar to handshake_util_find_gtk_kde.
This commit is contained in:
Andrew Zaborowski 2017-04-15 13:58:46 +02:00 committed by Denis Kenzior
parent b175e7ae06
commit f340ea510c
2 changed files with 17 additions and 0 deletions

View File

@ -525,6 +525,21 @@ const uint8_t *handshake_util_find_igtk_kde(const uint8_t *data,
return find_kde(data, data_len, out_igtk_len, igtk_oui);
}
const uint8_t *handshake_util_find_pmkid_kde(const uint8_t *data,
size_t data_len)
{
static const unsigned char pmkid_oui[] = { 0x00, 0x0f, 0xac, 0x04 };
const uint8_t *pmkid;
size_t pmkid_len;
pmkid = find_kde(data, data_len, &pmkid_len, pmkid_oui);
if (pmkid_len != 16)
return NULL;
return pmkid;
}
/*
* Unwrap a GTK / IGTK included in an FTE following 802.11-2012, Section 12.8.5:
*

View File

@ -142,3 +142,5 @@ const uint8_t *handshake_util_find_gtk_kde(const uint8_t *data, size_t data_len,
size_t *out_gtk_len);
const uint8_t *handshake_util_find_igtk_kde(const uint8_t *data,
size_t data_len, size_t *out_igtk_len);
const uint8_t *handshake_util_find_pmkid_kde(const uint8_t *data,
size_t data_len);