From patchwork Tue Feb 4 01:12:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wang X-Patchwork-Id: 1233076 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=T6hiG+nk; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IlkIV6il; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48BRbd1j8Tz9sWL for ; Tue, 4 Feb 2020 12:16:13 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dMvb9DPW0UPPxRWo5EcG6B9UOgt1HYsDdmpIiMKczY8=; b=T6hiG+nkr0uy1d BZo+l3i2h7JMv6gLqQRm35ZXOd+4/ytkMOCBlZh+ru3jKfIKDgIfoLkOgsm0ngh8dK9L4De+F6uns izmeA4Oxv5cfWJnHb6++mqbwc11Nn4NZ3qzBmCc3asZzdiL3CVwwyPjcdM3099C8lm4uhp5dMwqCM pcPJRKpn49lUSe0NfQKJwjiB+mzJCps8zcleudbRisNiMmdrMRz+wjEdS/dpne6pskA3NTezFdN2K YObOhAj7zhNeOWCd7yMyZdiCr2XiErFS1W936qLYuVBXbKdnrAY3mRxbHyYyxuja1W+yg/nVrYsJQ MISX/gUB+2x8IDEqofHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iymoz-0001ms-0r; Tue, 04 Feb 2020 01:16:09 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iymow-0001le-3G for hostap@lists.infradead.org; Tue, 04 Feb 2020 01:16:07 +0000 Received: by mail-pf1-x444.google.com with SMTP id y5so8526197pfb.11 for ; Mon, 03 Feb 2020 17:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=T1qkwlZm2kEcUF/hUPwvnF/0Hic0QcmLtdOs/eFyvk4=; b=IlkIV6ilqf/rsuU75zbcXgb9fZEWRIpbABSvQ/hERaOBGVUmXRxg7axM/uezP8mSC1 Ej1uiymk7+rCssNnDb98MDpkWIX9gjXvEgfDJLA3jMDg/lgBZRjvphO1bKNX+0wdbd5M NLggKZyM3c5d39iiQwYOtQ1PKFFjcIbRvhao8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=T1qkwlZm2kEcUF/hUPwvnF/0Hic0QcmLtdOs/eFyvk4=; b=Ezz3YvxVnC5ZEDb0Sokd0WzB2WvIgeIgqjyg9nMS21X8XD8AnrvhhtPA6gNoi14IxW L2f35k/3FlxAHyipkJRloUnycgxwJBEwCpncA2lkv+Mq0xmcS6G0eVYQ7K4XeBnUWpAB gm6ZpjQxkZV37NMgQH5TMluuKot1YSdD9Gl8RFy0Uh/qezTFnhQtU584g61HgEW92eRI SWkCa37m+S8lCIb3PLG5RNSM6mD7Cacq5/2uIgMKsFfO0iji8+PFhUUHDPfa8CfI7eqy D1ocfel6gYA/8K2zEigtrmrfn6GXwQPmprW75HeXyJp1gig8bOF6nAU3fh9hyY8++23G iEtw== X-Gm-Message-State: APjAAAWcdAySZu/cmd9t+6syAZFf+Hzj19tRSdJfTy5Rja2xnNbrrqQ+ iCOnjCqzUbWCXj+Ysqy/YrcgU9dhTkE= X-Google-Smtp-Source: APXvYqxHQpUN0OcPA4Ozuq4Lm/TP6Kf5if89+WcGQB+lLvhMCNNfazKSf1D++L5BIZlrGIUO4uN+dw== X-Received: by 2002:aa7:9aa5:: with SMTP id x5mr28096092pfi.131.1580778963388; Mon, 03 Feb 2020 17:16:03 -0800 (PST) Received: from localhost ([2620:15c:202:201:2b10:8627:31e7:c5ec]) by smtp.gmail.com with ESMTPSA id 28sm17795708pgl.42.2020.02.03.17.16.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Feb 2020 17:16:02 -0800 (PST) From: Matthew Wang To: j@w1.fi Subject: [PATCH v1] check for FT support when selecting FT suites Date: Mon, 3 Feb 2020 17:12:05 -0800 Message-Id: <20200204011204.2912-1-matthewmwang@chromium.org> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200203_171606_159895_C218FA19 X-CRM114-Status: GOOD ( 13.05 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hostap@lists.infradead.org, Matthew Wang Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org A driver supports FT if it either supports SME or the NL80211_CMD_UPDATE_FT_IES command. When selecting AKM suites, wpa_supplicant currently doesn't take into account whether or not either of those conditions are met. This can cause association failures e.g. when an AP supports both WPA-EAP and FT-EAP but the driver doesn't support FT (supplicant will decide to do FT-EAP since it is unaware the driver doesn't support it). This change allows an FT suite to be selected only when the driver also supports FT. Signed-off-by: Matthew Wang Reviewed-by: Brian Norris --- src/drivers/driver.h | 2 ++ src/drivers/driver_nl80211_capa.c | 7 +++++++ wpa_supplicant/wpa_supplicant.c | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 9bdf88011..601b3e24c 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1823,6 +1823,8 @@ struct wpa_driver_capa { #define WPA_DRIVER_FLAGS_CONTROL_PORT 0x0400000000000000ULL /** Driver supports VLAN offload */ #define WPA_DRIVER_FLAGS_VLAN_OFFLOAD 0x0800000000000000ULL +/** Driver supports UPDATE_FT_IES command */ +#define WPA_DRIVER_FLAGS_UPDATE_FT_IES 0x1000000000000000ULL u64 flags; #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \ diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 31e7cbfe5..6968e8e2a 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -78,6 +78,7 @@ struct wiphy_info_data { unsigned int wmm_ac_supported:1; unsigned int mac_addr_rand_scan_supported:1; unsigned int mac_addr_rand_sched_scan_supported:1; + unsigned int update_ft_ies_supported:1; }; @@ -243,6 +244,9 @@ static void wiphy_info_supp_cmds(struct wiphy_info_data *info, case NL80211_CMD_SET_QOS_MAP: info->set_qos_map_supported = 1; break; + case NL80211_CMD_UPDATE_FT_IES: + info->update_ft_ies_supported = 1; + break; } } } @@ -912,6 +916,9 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv, drv->capa.max_sched_scan_plan_iterations = 0; } + if (info->update_ft_ies_supported) + drv->capa.flags |= WPA_DRIVER_FLAGS_UPDATE_FT_IES; + return 0; } diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index aa7e1d09a..911727e05 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1458,6 +1458,10 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s, if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE)) sel &= ~(WPA_KEY_MGMT_SAE | WPA_KEY_MGMT_FT_SAE); #endif /* CONFIG_SAE */ +#ifdef CONFIG_IEEE80211R + if (!(wpa_s->drv_flags & (WPA_DRIVER_FLAGS_SME | WPA_DRIVER_FLAGS_UPDATE_FT_IES))) + sel &= ~WPA_KEY_MGMT_FT; +#endif /* CONFIG_IEEE80211R */ if (0) { #ifdef CONFIG_IEEE80211R #ifdef CONFIG_SHA384