All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/5] handshake: update TK installer/builder to take key index
@ 2021-10-08 18:07 James Prestwood
  0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2021-10-08 18:07 UTC (permalink / raw)
  To: iwd 

[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]

---
 src/handshake.c | 2 +-
 src/handshake.h | 1 +
 src/netdev.c    | 9 +++++----
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/handshake.c b/src/handshake.c
index ea1c5e4b..8b08379d 100644
--- a/src/handshake.c
+++ b/src/handshake.c
@@ -666,7 +666,7 @@ void handshake_state_install_ptk(struct handshake_state *s)
 
 		handshake_event(s, HANDSHAKE_EVENT_SETTING_KEYS);
 
-		install_tk(s, handshake_get_tk(s), cipher);
+		install_tk(s, s->active_tk_index, handshake_get_tk(s), cipher);
 	}
 }
 
diff --git a/src/handshake.h b/src/handshake.h
index 4cf2ec63..6d56dadd 100644
--- a/src/handshake.h
+++ b/src/handshake.h
@@ -68,6 +68,7 @@ typedef void (*handshake_event_func_t)(struct handshake_state *hs,
 
 typedef bool (*handshake_get_nonce_func_t)(uint8_t nonce[]);
 typedef void (*handshake_install_tk_func_t)(struct handshake_state *hs,
+					uint8_t key_index,
 					const uint8_t *tk, uint32_t cipher);
 typedef void (*handshake_install_gtk_func_t)(struct handshake_state *hs,
 					uint16_t key_index,
diff --git a/src/netdev.c b/src/netdev.c
index de155da1..de2f3d58 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -1735,9 +1735,9 @@ static struct l_genl_msg *netdev_build_cmd_new_key_pairwise(
 							uint32_t cipher,
 							const uint8_t *aa,
 							const uint8_t *tk,
-							size_t tk_len)
+							size_t tk_len,
+							uint8_t key_id)
 {
-	uint8_t key_id = 0;
 	struct l_genl_msg *msg;
 
 	msg = l_genl_msg_new_sized(NL80211_CMD_NEW_KEY, 512);
@@ -1775,7 +1775,7 @@ static void netdev_group_timeout_cb(struct l_timeout *timeout, void *user_data)
 	netdev_connect_ok(nhs->netdev);
 }
 
-static void netdev_set_tk(struct handshake_state *hs,
+static void netdev_set_tk(struct handshake_state *hs, uint8_t key_index,
 				const uint8_t *tk, uint32_t cipher)
 {
 	struct netdev_handshake_state *nhs =
@@ -1823,7 +1823,8 @@ static void netdev_set_tk(struct handshake_state *hs,
 		goto invalid_key;
 
 	msg = netdev_build_cmd_new_key_pairwise(netdev, cipher, addr, tk_buf,
-						crypto_cipher_key_len(cipher));
+						crypto_cipher_key_len(cipher),
+						key_index);
 	nhs->pairwise_new_key_cmd_id =
 		l_genl_family_send(nl80211, msg, netdev_new_pairwise_key_cb,
 						nhs, NULL);
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v4 1/5] handshake: update TK installer/builder to take key index
@ 2021-10-08 18:28 Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-10-08 18:28 UTC (permalink / raw)
  To: iwd 

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

Hi James,

On 10/8/21 1:07 PM, James Prestwood wrote:
> ---
>   src/handshake.c | 2 +-
>   src/handshake.h | 1 +
>   src/netdev.c    | 9 +++++----
>   3 files changed, 7 insertions(+), 5 deletions(-)
> 

All applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-08 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-08 18:28 [PATCH v4 1/5] handshake: update TK installer/builder to take key index Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2021-10-08 18:07 James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.