diff mbox series

[03/26] ie: Rename _BIP to _BIP_CMAC

Message ID 20221021191307.31492-3-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:12 p.m. UTC
---
 src/ie.c       | 15 ++++++++-------
 src/ie.h       |  2 +-
 src/wiphy.c    | 13 +++++++------
 unit/test-ie.c |  2 +-
 4 files changed, 17 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/src/ie.c b/src/ie.c
index 245b59c91ad3..7159222a4f6c 100644
--- a/src/ie.c
+++ b/src/ie.c
@@ -428,7 +428,7 @@  uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite)
 		return CRYPTO_CIPHER_WEP40;
 	case IE_RSN_CIPHER_SUITE_WEP104:
 		return CRYPTO_CIPHER_WEP104;
-	case IE_RSN_CIPHER_SUITE_BIP:
+	case IE_RSN_CIPHER_SUITE_BIP_CMAC:
 		return CRYPTO_CIPHER_BIP_CMAC;
 	default:
 		return 0;
@@ -462,7 +462,7 @@  static bool ie_parse_cipher_suite(const uint8_t *data,
 			*out = IE_RSN_CIPHER_SUITE_WEP104;
 			return true;
 		case 6:
-			*out = IE_RSN_CIPHER_SUITE_BIP;
+			*out = IE_RSN_CIPHER_SUITE_BIP_CMAC;
 			return true;
 		case 7:
 			*out = IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC;
@@ -625,7 +625,7 @@  static bool ie_parse_group_management_cipher(const uint8_t *data,
 		return r;
 
 	switch (tmp) {
-	case IE_RSN_CIPHER_SUITE_BIP:
+	case IE_RSN_CIPHER_SUITE_BIP_CMAC:
 	case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC:
 		break;
 	default:
@@ -746,7 +746,8 @@  static int parse_ciphers(const uint8_t *data, size_t len,
 	 * management frame protection enabled
 	 */
 	if (out_info->mfpc)
-		out_info->group_management_cipher = IE_RSN_CIPHER_SUITE_BIP;
+		out_info->group_management_cipher =
+						IE_RSN_CIPHER_SUITE_BIP_CMAC;
 
 	RSNE_ADVANCE(data, len, 2);
 
@@ -905,7 +906,7 @@  static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui,
 		memcpy(data, oui, 3);
 		data[3] = 5;
 		return true;
-	case IE_RSN_CIPHER_SUITE_BIP:
+	case IE_RSN_CIPHER_SUITE_BIP_CMAC:
 		memcpy(data, oui, 3);
 		data[3] = 6;
 		return true;
@@ -1115,7 +1116,7 @@  static int build_ciphers_common(const struct ie_rsn_info *info, uint8_t *to,
 		else if (!info->mfpc)
 			goto done;
 		else if (info->group_management_cipher ==
-				IE_RSN_CIPHER_SUITE_BIP)
+				IE_RSN_CIPHER_SUITE_BIP_CMAC)
 			goto done;
 	}
 
@@ -1136,7 +1137,7 @@  static int build_ciphers_common(const struct ie_rsn_info *info, uint8_t *to,
 		goto done;
 
 	if (!force_group_mgmt_cipher && info->group_management_cipher ==
-							IE_RSN_CIPHER_SUITE_BIP)
+					IE_RSN_CIPHER_SUITE_BIP_CMAC)
 		goto done;
 
 	/* Group Management Cipher Suite */
diff --git a/src/ie.h b/src/ie.h
index e56df984e53c..e7ffaa63f74d 100644
--- a/src/ie.h
+++ b/src/ie.h
@@ -329,7 +329,7 @@  enum ie_rsn_cipher_suite {
 	IE_RSN_CIPHER_SUITE_TKIP		= 0x0004,
 	IE_RSN_CIPHER_SUITE_CCMP		= 0x0008,
 	IE_RSN_CIPHER_SUITE_WEP104		= 0x0010,
-	IE_RSN_CIPHER_SUITE_BIP			= 0x0020,
+	IE_RSN_CIPHER_SUITE_BIP_CMAC		= 0x0020,
 	IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC	= 0x0040,
 };
 
diff --git a/src/wiphy.c b/src/wiphy.c
index 1283bede923e..3e08047910e1 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -157,8 +157,8 @@  enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask)
 	if (mask & IE_RSN_CIPHER_SUITE_TKIP)
 		return IE_RSN_CIPHER_SUITE_TKIP;
 
-	if (mask & IE_RSN_CIPHER_SUITE_BIP)
-		return IE_RSN_CIPHER_SUITE_BIP;
+	if (mask & IE_RSN_CIPHER_SUITE_BIP_CMAC)
+		return IE_RSN_CIPHER_SUITE_BIP_CMAC;
 
 	return 0;
 }
@@ -178,7 +178,7 @@  static bool wiphy_can_connect_sae(struct wiphy *wiphy)
 	 * WPA3 Specification version 3, Section 2.3:
 	 * A STA shall negotiate PMF when associating to an AP using SAE
 	 */
-	if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP)) {
+	if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP_CMAC)) {
 		l_debug("HW not MFP capable, can't use SAE");
 		return false;
 	}
@@ -488,7 +488,7 @@  bool wiphy_can_transition_disable(struct wiphy *wiphy)
 	if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_CCMP))
 		return false;
 
-	if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP))
+	if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP_CMAC))
 		return false;
 
 	return true;
@@ -1145,7 +1145,7 @@  static void wiphy_print_basic_info(struct wiphy *wiphy)
 		if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_TKIP)
 			len += sprintf(buf + len, " TKIP");
 
-		if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP)
+		if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP_CMAC)
 			len += sprintf(buf + len, " BIP");
 
 		l_info("%s", buf);
@@ -1216,7 +1216,8 @@  static void parse_supported_ciphers(struct wiphy *wiphy, const void *data,
 			wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_WEP104;
 			break;
 		case CRYPTO_CIPHER_BIP_CMAC:
-			wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_BIP;
+			wiphy->supported_ciphers |=
+				IE_RSN_CIPHER_SUITE_BIP_CMAC;
 			break;
 		default:	/* TODO: Support other ciphers */
 			break;
diff --git a/unit/test-ie.c b/unit/test-ie.c
index 709b745428b9..7ea84c387121 100644
--- a/unit/test-ie.c
+++ b/unit/test-ie.c
@@ -423,7 +423,7 @@  static const struct ie_rsne_info_test ie_rsne_info_test_6 = {
 	.pairwise_ciphers = IE_RSN_CIPHER_SUITE_CCMP,
 	.akm_suites = IE_RSN_AKM_SUITE_8021X,
 	.mfpc = true, /* Management frame protection is enabled, not required */
-	.group_management_cipher = IE_RSN_CIPHER_SUITE_BIP,
+	.group_management_cipher = IE_RSN_CIPHER_SUITE_BIP_CMAC,
 };
 
 static void ie_test_rsne_info(const void *data)