diff mbox series

[24/26] netdev: Support more IGTK cipher suites

Message ID 20221021191307.31492-24-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/netdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/netdev.c b/src/netdev.c
index 7b8948604347..636c02dea51a 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -1674,7 +1674,7 @@  static void netdev_set_igtk(struct handshake_state *hs, uint16_t key_index,
 {
 	struct netdev_handshake_state *nhs =
 		l_container_of(hs, struct netdev_handshake_state, super);
-	uint8_t igtk_buf[16];
+	uint8_t igtk_buf[32];
 	struct netdev *netdev = nhs->netdev;
 	struct l_genl_msg *msg;
 
@@ -1690,7 +1690,10 @@  static void netdev_set_igtk(struct handshake_state *hs, uint16_t key_index,
 
 	switch (cipher) {
 	case CRYPTO_CIPHER_BIP_CMAC:
-		memcpy(igtk_buf, igtk, 16);
+	case CRYPTO_CIPHER_BIP_GMAC:
+	case CRYPTO_CIPHER_BIP_GMAC_256:
+	case CRYPTO_CIPHER_BIP_CMAC_256:
+		memcpy(igtk_buf, igtk, igtk_len);
 		break;
 	default:
 		l_error("Unexpected cipher: %x", cipher);