From b5b815ef1690e497232fc8c8fa4297c4bb4b7e21 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 30 Mar 2021 14:09:15 -0700 Subject: [PATCH] wiphy: Use wiphy_select_akm in wiphy_can_connect Commit 6e8b76527 added a switch statement for AKM suites which was not correct as this is a bitmask and may contain multiple values. Intead we can rely on wiphy_select_akm which is a more robust check anyways. Fixes: 6e8b7652788a ("wiphy: add check for CMD_AUTH/CMD_ASSOC support") --- src/wiphy.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/wiphy.c b/src/wiphy.c index 676f236c..ab57a2d2 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -407,24 +407,7 @@ bool wiphy_can_connect(struct wiphy *wiphy, struct scan_bss *bss) rsn_info.group_management_cipher)) return false; - - switch (rsn_info.akm_suites) { - case IE_RSN_AKM_SUITE_SAE_SHA256: - case IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256: - if (!wiphy_can_connect_sae(wiphy)) - return false; - - break; - case IE_RSN_AKM_SUITE_OWE: - case IE_RSN_AKM_SUITE_FILS_SHA256: - case IE_RSN_AKM_SUITE_FILS_SHA384: - case IE_RSN_AKM_SUITE_FT_OVER_FILS_SHA256: - case IE_RSN_AKM_SUITE_FT_OVER_FILS_SHA384: - if (!wiphy->support_cmds_auth_assoc) - return false; - - break; - } + return wiphy_select_akm(wiphy, bss, false); } else if (r != -ENOENT) return false;