From b373d1fa69e89286a0fbf06265921155a6b273a0 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 11 Jan 2023 12:15:40 -0800 Subject: [PATCH] netdev: support HANDSHAKE_EVENT_REKEY_COMPLETE In try_handshake_complete() we return early if all the keys had been installed before (initial associations). For rekeys we can now emit the REKEY_COMPLETE event which lets AP mode reset the rekey timer for that station. --- src/netdev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index fc8a2afa..035dbd00 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1469,8 +1469,13 @@ static void netdev_setting_keys_failed(struct netdev_handshake_state *nhs, static void try_handshake_complete(struct netdev_handshake_state *nhs) { - if (nhs->ptk_installed && nhs->gtk_installed && nhs->igtk_installed && - !nhs->complete) { + if (nhs->ptk_installed && nhs->gtk_installed && nhs->igtk_installed) { + if (nhs->complete) { + handshake_event(&nhs->super, + HANDSHAKE_EVENT_REKEY_COMPLETE); + return; + } + nhs->complete = true; if (handshake_event(&nhs->super, HANDSHAKE_EVENT_COMPLETE))