mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-20 12:39:25 +01:00
wiphy: Detect IE type in key install callbacks
This commit is contained in:
parent
6cae91572f
commit
27d18cdd96
32
src/wiphy.c
32
src/wiphy.c
@ -955,14 +955,22 @@ static void wiphy_set_tk(uint32_t ifindex, const uint8_t *aa,
|
|||||||
struct network *network = netdev->connected_network;
|
struct network *network = netdev->connected_network;
|
||||||
struct ie_rsn_info info;
|
struct ie_rsn_info info;
|
||||||
enum crypto_cipher cipher;
|
enum crypto_cipher cipher;
|
||||||
|
int result;
|
||||||
|
|
||||||
l_debug("");
|
l_debug("");
|
||||||
|
|
||||||
/* If we have the RSN element we must be in WPA2 mode */
|
if (rsn[0] == IE_TYPE_RSN)
|
||||||
if (netdev->connected_bss->rsne)
|
result = ie_parse_rsne_from_data(rsn, rsn[1] + 2, &info);
|
||||||
ie_parse_rsne_from_data(rsn, rsn[1] + 2, &info);
|
else if (rsn[0] == IE_TYPE_VENDOR_SPECIFIC)
|
||||||
|
result = ie_parse_wpa_from_data(rsn, rsn[1] + 2, &info);
|
||||||
else
|
else
|
||||||
ie_parse_wpa_from_data(rsn, rsn[1] + 2, &info);
|
result = -1;
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
l_error("Can't parse the RSN");
|
||||||
|
setting_keys_failed(netdev, MPDU_REASON_CODE_INVALID_IE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (info.pairwise_ciphers) {
|
switch (info.pairwise_ciphers) {
|
||||||
case IE_RSN_CIPHER_SUITE_CCMP:
|
case IE_RSN_CIPHER_SUITE_CCMP:
|
||||||
@ -1103,14 +1111,22 @@ static void wiphy_set_gtk(uint32_t ifindex, uint8_t key_index,
|
|||||||
struct netdev *netdev = user_data;
|
struct netdev *netdev = user_data;
|
||||||
struct ie_rsn_info info;
|
struct ie_rsn_info info;
|
||||||
enum crypto_cipher cipher;
|
enum crypto_cipher cipher;
|
||||||
|
int result;
|
||||||
|
|
||||||
l_debug("");
|
l_debug("");
|
||||||
|
|
||||||
/* If we have the RSN element we must be in WPA2 mode */
|
if (rsn[0] == IE_TYPE_RSN)
|
||||||
if (netdev->connected_bss->rsne)
|
result = ie_parse_rsne_from_data(rsn, rsn[1] + 2, &info);
|
||||||
ie_parse_rsne_from_data(rsn, rsn[1] + 2, &info);
|
else if (rsn[0] == IE_TYPE_VENDOR_SPECIFIC)
|
||||||
|
result = ie_parse_wpa_from_data(rsn, rsn[1] + 2, &info);
|
||||||
else
|
else
|
||||||
ie_parse_wpa_from_data(rsn, rsn[1] + 2, &info);
|
result = -1;
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
l_error("Can't parse the RSN");
|
||||||
|
setting_keys_failed(netdev, MPDU_REASON_CODE_INVALID_IE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (info.group_cipher) {
|
switch (info.group_cipher) {
|
||||||
case IE_RSN_CIPHER_SUITE_CCMP:
|
case IE_RSN_CIPHER_SUITE_CCMP:
|
||||||
|
Loading…
Reference in New Issue
Block a user