]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
STA: Fix wpa_clear_keys() PTK key deletion logic
authorAlexander Wetzel <alexander@wetzel-home.de>
Mon, 23 Mar 2020 18:42:28 +0000 (19:42 +0100)
committerJouni Malinen <j@w1.fi>
Wed, 25 Mar 2020 22:33:17 +0000 (00:33 +0200)
We have to delete PTK keys when either BIT(0) or BIT(15) are zero and
not only when both are zero.

Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
wpa_supplicant/wpa_supplicant.c

index f11bac0174c8a3fcbc2d209434e94bdb78ca711e..a01a3e748831dc56be7cbbae3ae21b334247cda6 100644 (file)
@@ -749,7 +749,7 @@ void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr)
                                NULL, 0, KEY_FLAG_GROUP);
        }
        /* Pairwise Key ID 1 for Extended Key ID is tracked in bit 15 */
-       if (!(wpa_s->keys_cleared & (BIT(0) | BIT(15))) && addr &&
+       if (~wpa_s->keys_cleared & (BIT(0) | BIT(15)) && addr &&
            !is_zero_ether_addr(addr)) {
                if (!(wpa_s->keys_cleared & BIT(0)))
                        wpa_drv_set_key(wpa_s, WPA_ALG_NONE, addr, 0, 0, NULL,