diff mbox series

[23/26] ie: Support more group management cipher suites

Message ID 20221021191307.31492-23-denkenz@gmail.com (mailing list archive)
State New
Headers show
Series [01/26] eapol: More strictly validate key_descriptor_version | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

Denis Kenzior Oct. 21, 2022, 7:13 p.m. UTC
---
 src/ie.c | 33 +++++++++++++++++++++++++++++++++
 src/ie.h |  3 +++
 2 files changed, 36 insertions(+)
diff mbox series

Patch

diff --git a/src/ie.c b/src/ie.c
index 4a3e02e11cac..6b08ce180a87 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 e69175635908..533118541d6c 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 {