From 17131c860ab7ed545759abae30df859e25c6912c Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 21 Oct 2022 13:40:44 -0500 Subject: [PATCH] ie: Support more group management cipher suites --- src/ie.c | 33 +++++++++++++++++++++++++++++++++ src/ie.h | 3 +++ 2 files changed, 36 insertions(+) diff --git a/src/ie.c b/src/ie.c index 4a3e02e1..6b08ce18 100644 --- a/src/ie.c +++ b/src/ie.c @@ -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; diff --git a/src/ie.h b/src/ie.h index e6917563..53311854 100644 --- a/src/ie.h +++ b/src/ie.h @@ -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 {