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

ie: Support more group management cipher suites

This commit is contained in:
Denis Kenzior 2022-10-21 13:40:44 -05:00
parent 3f60bd7e63
commit 17131c860a
2 changed files with 36 additions and 0 deletions

View File

@ -436,6 +436,12 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite)
return CRYPTO_CIPHER_GCMP_256;
case IE_RSN_CIPHER_SUITE_CCMP_256:
return CRYPTO_CIPHER_CCMP_256;
case IE_RSN_CIPHER_SUITE_BIP_GMAC:
return CRYPTO_CIPHER_BIP_GMAC;
case IE_RSN_CIPHER_SUITE_BIP_GMAC_256:
return CRYPTO_CIPHER_BIP_GMAC_256;
case IE_RSN_CIPHER_SUITE_BIP_CMAC_256:
return CRYPTO_CIPHER_BIP_CMAC_256;
default:
return 0;
}
@ -464,6 +470,12 @@ const char *ie_rsn_cipher_suite_to_string(enum ie_rsn_cipher_suite suite)
return "NO-TRAFFIC";
case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER:
break;
case IE_RSN_CIPHER_SUITE_BIP_GMAC:
return "BIP-GMAC-128";
case IE_RSN_CIPHER_SUITE_BIP_GMAC_256:
return "BIP-GMAC-256";
case IE_RSN_CIPHER_SUITE_BIP_CMAC_256:
return "BIP-CMAC-256";
}
return NULL;
@ -510,6 +522,15 @@ static bool ie_parse_cipher_suite(const uint8_t *data,
case 10:
*out = IE_RSN_CIPHER_SUITE_CCMP_256;
return true;
case 11:
*out = IE_RSN_CIPHER_SUITE_BIP_GMAC;
return true;
case 12:
*out = IE_RSN_CIPHER_SUITE_BIP_GMAC_256;
return true;
case 13:
*out = IE_RSN_CIPHER_SUITE_BIP_CMAC_256;
return true;
default:
return false;
}
@ -675,6 +696,9 @@ static bool ie_parse_group_management_cipher(const uint8_t *data,
switch (tmp) {
case IE_RSN_CIPHER_SUITE_BIP_CMAC:
case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC:
case IE_RSN_CIPHER_SUITE_BIP_GMAC:
case IE_RSN_CIPHER_SUITE_BIP_GMAC_256:
case IE_RSN_CIPHER_SUITE_BIP_CMAC_256:
break;
default:
return false;
@ -969,6 +993,15 @@ static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui,
case IE_RSN_CIPHER_SUITE_CCMP_256:
selector = 10;
goto done;
case IE_RSN_CIPHER_SUITE_BIP_GMAC:
selector = 11;
goto done;
case IE_RSN_CIPHER_SUITE_BIP_GMAC_256:
selector = 12;
goto done;
case IE_RSN_CIPHER_SUITE_BIP_CMAC_256:
selector = 13;
goto done;
}
return false;

View File

@ -334,6 +334,9 @@ enum ie_rsn_cipher_suite {
IE_RSN_CIPHER_SUITE_GCMP = 0x0080,
IE_RSN_CIPHER_SUITE_GCMP_256 = 0x0100,
IE_RSN_CIPHER_SUITE_CCMP_256 = 0x0200,
IE_RSN_CIPHER_SUITE_BIP_GMAC = 0x0400,
IE_RSN_CIPHER_SUITE_BIP_GMAC_256 = 0x0800,
IE_RSN_CIPHER_SUITE_BIP_CMAC_256 = 0x1000,
};
enum ie_rsn_akm_suite {