diff mbox series

[5/9] netdev: unset ptk_installed flag for TK

Message ID 20230111201543.397692-5-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/9] eapol: set secure on message 2/4 properly | expand

Checks

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

Commit Message

James Prestwood Jan. 11, 2023, 8:15 p.m. UTC
When the TK is installed the 'ptk_installed' flag was never set to
zero. For initial associations this was fine (already zero) but for
rekeys the flag needs to be unset so try_handshake_complete knows
if the key was installed. This is consistent with how gtk/igtk keys
work as well.
---
 src/netdev.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/src/netdev.c b/src/netdev.c
index cda8d183..fc8a2afa 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -2024,6 +2024,8 @@  static void netdev_set_tk(struct handshake_state *hs, uint8_t key_index,
 	const uint8_t *addr = netdev_choose_key_address(nhs);
 	int err;
 
+	nhs->ptk_installed = false;
+
 	/*
 	 * WPA1 does the group handshake after the 4-way finishes so we can't
 	 * rely on the gtk/igtk being set immediately after the ptk. Since