mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-14 16:09:24 +01:00
ie: Add utility to parse pairwise cipher suites
This utility works by validating values that make sense for pairwise ciphers.
This commit is contained in:
parent
4216cf793b
commit
2b7432bddb
25
src/ie.c
25
src/ie.c
@ -293,3 +293,28 @@ static bool ie_parse_group_cipher(const uint8_t *data,
|
||||
*out = tmp;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ie_parse_pairwise_cipher(const uint8_t *data,
|
||||
enum ie_rsn_cipher_suite *out)
|
||||
{
|
||||
enum ie_rsn_cipher_suite tmp;
|
||||
|
||||
bool r = ie_parse_cipher_suite(data, &tmp);
|
||||
|
||||
if (!r)
|
||||
return r;
|
||||
|
||||
switch (tmp) {
|
||||
case IE_RSN_CIPHER_SUITE_CCMP:
|
||||
case IE_RSN_CIPHER_SUITE_TKIP:
|
||||
case IE_RSN_CIPHER_SUITE_WEP104:
|
||||
case IE_RSN_CIPHER_SUITE_WEP40:
|
||||
case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
*out = tmp;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user