diff mbox series

[12/26] wiphy: Support GCMP cipher suite

Message ID 20221021191307.31492-12-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/station.c | 3 ++-
 src/wiphy.c   | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/station.c b/src/station.c
index 294edd615107..e0c163fb7e44 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1167,7 +1167,8 @@  build_ie:
 	 * also indicates support.
 	 */
 	if (wiphy_supports_ext_key_id(wiphy) && bss_info.extended_key_id &&
-			info.pairwise_ciphers == IE_RSN_CIPHER_SUITE_CCMP)
+			(info.pairwise_ciphers & (IE_RSN_CIPHER_SUITE_CCMP |
+						  IE_RSN_CIPHER_SUITE_GCMP)))
 		info.extended_key_id = true;
 
 	/* RSN takes priority */
diff --git a/src/wiphy.c b/src/wiphy.c
index da4610d094d5..f0451b60416e 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -150,7 +150,9 @@  enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask)
 
 	mask &= wiphy->supported_ciphers;
 
-	/* CCMP is our first choice, TKIP second */
+	if (mask & IE_RSN_CIPHER_SUITE_GCMP)
+		return IE_RSN_CIPHER_SUITE_GCMP;
+
 	if (mask & IE_RSN_CIPHER_SUITE_CCMP)
 		return IE_RSN_CIPHER_SUITE_CCMP;
 
@@ -1234,6 +1236,9 @@  static void parse_supported_ciphers(struct wiphy *wiphy, const void *data,
 			wiphy->supported_ciphers |=
 				IE_RSN_CIPHER_SUITE_BIP_CMAC;
 			break;
+		case CRYPTO_CIPHER_GCMP:
+			wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_GCMP;
+			break;
 		default:	/* TODO: Support other ciphers */
 			break;
 		}