From 53469c5c0da6b3f644b014c81d22f08bca7d938e Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 1 Nov 2022 13:17:44 -0700 Subject: [PATCH] netdev: fix key setting for authenticators The netdev_copy_tk function was being hard coded with authenticator set to false. This isn't important for any ciphers except TKIP but now that AP mode supports TKIP it needs to be fixed. --- src/netdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index fd4bf52c..735b70da 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1643,7 +1643,7 @@ static void netdev_set_gtk(struct handshake_state *hs, uint16_t key_index, return; } - if (!netdev_copy_tk(gtk_buf, gtk, cipher, false)) { + if (!netdev_copy_tk(gtk_buf, gtk, cipher, hs->authenticator)) { netdev_setting_keys_failed(nhs, -ENOENT); return; } @@ -2057,7 +2057,7 @@ static void netdev_set_tk(struct handshake_state *hs, uint8_t key_index, l_debug("ifindex=%d key_idx=%u", netdev->index, key_index); err = -ENOENT; - if (!netdev_copy_tk(tk_buf, tk, cipher, false)) + if (!netdev_copy_tk(tk_buf, tk, cipher, hs->authenticator)) goto invalid_key; msg = netdev_build_cmd_new_key_pairwise(netdev, cipher, addr, tk_buf, @@ -2091,7 +2091,7 @@ static void netdev_set_ext_tk(struct handshake_state *hs, uint8_t key_idx, L_BE16_TO_CPU(step4->header.packet_len); err = -ENOENT; - if (!netdev_copy_tk(tk_buf, tk, cipher, false)) + if (!netdev_copy_tk(tk_buf, tk, cipher, hs->authenticator)) goto error; msg = netdev_build_cmd_new_rx_key_pairwise(netdev, cipher, addr, tk_buf,