From patchwork Sun Feb 4 01:50:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 868968 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YCYL4/+c"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Wr7UM7Q2"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zYtx101Nlz9sR8 for ; Sun, 4 Feb 2018 12:51:17 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To: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:List-Owner; bh=efcxVEbXdfOmv2YDPXPcwurU9+ePtQcFu8zgg5A3hz4=; b=YCYL4/+cib/z/bGsxuKwP6s4bu sRgesnAqxO3SjoLlJW4hQy6fRnBonmlCR/9bOD3uh3Y+M/dsUl0ofU1aO7issOfscIoTPcDDxt4hR d1Xi4elBlqE3TJ3oXuNnWQLPIpDcDXEsIb42iRe4IinqmY4nU/WlFb37pEPlQUIqu+vBAsSMbikXY 9ZT8Dn/YCzVMyuLbZkjANAvd6WljzpqvGFw+sL29Zw8YCYdm2hN2PCKKXLWlQ5YiO0jvGK/6fD1Hf Kde6WopbQhWl6Ps+sJZaZE6f8M8lgh5lqchx/W1qmbsQq+3qPhucF+OTMIzFL11T4esk7ZGnTuLPh CJPFKoYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ei9SS-0000Jn-7y; Sun, 04 Feb 2018 01:51:04 +0000 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ei9SO-0000Iz-OF for hostap@lists.infradead.org; Sun, 04 Feb 2018 01:51:03 +0000 Received: by mail-pl0-x241.google.com with SMTP id g18so9233453plo.7 for ; Sat, 03 Feb 2018 17:50:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eYwXgQrT/yMojh0HrOT37BHJBxxvXOPvFQHyIY+wHtI=; b=Wr7UM7Q2UpnPFyBNXUaONIMM5euERzNDNpbBAg1IsOSZE8bEyUdJAT6y0Rafp9paMs +Z197I7SpjEDhH+ChgYOU+6QNsbms0NMhY6nlQay1u0BCGSDD6ive3u/B9fJLl9CsZxo NmgfkKFByJUiosa72WOZUqzG0D1UQhHmCHAmiBQY/QgxkfCtWBpap9Ifuiy5bMBXb+P/ SWy/q3Cf8/oMQFMdNpBLz/IXZU+gS4XPq7hhNN/z3VFffqipbisvJoQZyEmoe6GT1gg1 q9sguxGo8ZpKsLXE7LzsLYAa4eSWLtg34x6JU9RnPZuDUIYLC/MAgGyVWWmsirxv5Pxl KogA== 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:in-reply-to :references; bh=eYwXgQrT/yMojh0HrOT37BHJBxxvXOPvFQHyIY+wHtI=; b=GBc7/AhYrlck3AGxCOXzINu35Mn9X0FqdFrDiJA0TGmxELJhALu672E+DtTMXgMouZ DJFTWW9o2DKcGcVerMxJ8a5MUXxB/y1P1gziZEHYbrhtaerZsCnH91Un90RR6yChlFZD XZcffbFLVyVoeB9eCuCG5r4M5X1j7AnF972EtY09lQ2Yxdp+ljheWg6GGx5uHjXUmhXX +SobnVZid6NtB3Hnrn1GqLTYKcIIfKnquWklbxebtl1pksVREjxICzwbEJNTA+QTXCkX 1GD1fdNA9InuuvIeNbh7MZ1KCQlQgrzy4WCj9Y+o+n6I8QSDfGTTAC2CGgCCcavaCGSR QH1Q== X-Gm-Message-State: AKwxytdJu0sSzenK4DHbAMAk84yCZ+BmboZ0HfNxXoANYaIAJOfe8h4g wKuNIZ/l0YRgMpQmmprl7VcarA== X-Google-Smtp-Source: AH8x224j5sKLlmDyYoNuoCJpQaiK8c/XeskBVfVPrkwZZs2UI9MCCuuGa4V7Z/Nz9oXmr+EAHNxwpg== X-Received: by 2002:a17:902:8c8b:: with SMTP id t11-v6mr39061715plo.286.1517709049565; Sat, 03 Feb 2018 17:50:49 -0800 (PST) Received: from localhost.localdomain (p4a0ad0.kngwnt01.ap.so-net.ne.jp. [120.74.10.208]) by smtp.gmail.com with ESMTPSA id b8sm10045553pff.31.2018.02.03.17.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Feb 2018 17:50:48 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH v2 1/2] wpa_cli: Fix duplicate const warning Date: Sun, 4 Feb 2018 10:50:36 +0900 Message-Id: <1517709037-5015-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515383840-7921-1-git-send-email-masashi.honma@gmail.com> References: <1515383840-7921-1-git-send-email-masashi.honma@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c01:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org wpa_cli.c:1541:19: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] static const char const *cred_fields[] = { ^~~~~ Signed-off-by: Masashi Honma --- wpa_supplicant/wpa_cli.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 7d2d6ac..6b98a3f 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -1538,22 +1538,21 @@ static int wpa_cli_cmd_remove_cred(struct wpa_ctrl *ctrl, int argc, } -static const char const *cred_fields[] = { - "temporary", "priority", "sp_priority", "pcsc", "eap", - "update_identifier", "min_dl_bandwidth_home", "min_ul_bandwidth_home", - "min_dl_bandwidth_roaming", "min_ul_bandwidth_roaming", "max_bss_load", - "req_conn_capab", "ocsp", "sim_num", "realm", "username", "password", - "ca_cert", "client_cert", "private_key", "private_key_passwd", "imsi", - "milenage", "domain_suffix_match", "domain", "phase1", "phase2", - "roaming_consortium", "required_roaming_consortium", "excluded_ssid", - "roaming_partner", "provisioning_sp" -}; - - static char ** wpa_cli_complete_cred(const char *str, int pos) { int arg = get_cmd_arg_num(str, pos); - int i, num_fields = ARRAY_SIZE(cred_fields); + const char *fields[] = { + "temporary", "priority", "sp_priority", "pcsc", "eap", + "update_identifier", "min_dl_bandwidth_home", + "min_ul_bandwidth_home", "min_dl_bandwidth_roaming", + "min_ul_bandwidth_roaming", "max_bss_load", "req_conn_capab", + "ocsp", "sim_num", "realm", "username", "password", "ca_cert", + "client_cert", "private_key", "private_key_passwd", "imsi", + "milenage", "domain_suffix_match", "domain", "phase1", "phase2", + "roaming_consortium", "required_roaming_consortium", + "excluded_ssid", "roaming_partner", "provisioning_sp" + }; + int i, num_fields = ARRAY_SIZE(fields); char **res = NULL; switch (arg) { @@ -1565,7 +1564,7 @@ static char ** wpa_cli_complete_cred(const char *str, int pos) if (res == NULL) return NULL; for (i = 0; i < num_fields; i++) { - res[i] = os_strdup(cred_fields[i]); + res[i] = os_strdup(fields[i]); if (res[i] == NULL) break; } From patchwork Sun Feb 4 01:50:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 868969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q4EEVmiR"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aScA9rQv"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zYtxH3LrRz9sR8 for ; Sun, 4 Feb 2018 12:51:30 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To: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:List-Owner; bh=HSeDMkXQrGw1G5n3SHnTI2l/Z0CKCzC6mAbzqHSbs2s=; b=q4EEVmiRFl/nMdVxMlJPdlaOSj x7Dsd9uU2c+CnwC6UeSBerOIGi9JY7O6MI7WURXxQaymBI5QdfD3chww3zyLdEmwmRYflCEwLKZfO pniDQ/SPh9w2V/PujP13yqf5kCzU9QM7o+cOQNF/9xCOE+zkz2TEb0mc2R59S7DECt1Y93PN3vln9 uFI3dDFniQXzSX3KESY/HUwxMAKX7WuMXOGC8wYe4pZP2cdlt7yaBEGp7BhIZonZc5N2AJteaKNBy GhY6wryx8xQagiPgktcv5uBVj97+XnKgVHK775iJ57xtZp79eztD7ipeQhcQDyk93eNtOa/PvRZjZ fBq/0GFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ei9SW-0000Nx-C1; Sun, 04 Feb 2018 01:51:08 +0000 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ei9SQ-0000J3-NY for hostap@lists.infradead.org; Sun, 04 Feb 2018 01:51:04 +0000 Received: by mail-pl0-x242.google.com with SMTP id j19so9246306pll.2 for ; Sat, 03 Feb 2018 17:50:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kMPZfG0/lxrDyy6q8qY41nJeI4N2npqyyqxYt1MRKRI=; b=aScA9rQvl9I91qx2fnk6Xat9Sz9Zpv/2N0qFIhFu/bkFInBx3XNEoUDVUgt+Q6E83W cCaouryBG9lhwRDBXf+eZ/7li+P/DIXdbeyFa06vnNCA+ddFIBT7sFceE1fNZ0FXan+F B5PylmjmtzxCezmWx+vzdg0n3VdzrST+Vsc1dt6Z4Xoa43sReMUoQywFJLC7WPinKrL/ 5GFfWP6gE/uPZOWWWp+i6sCJMfO9NfsdtrHD3qRW7KCQ0S0N5TDMG80rtqI0xCfQm2YO TSCnIrbcL+KVAAUohlonOBLmqgu/qFtcoXeB0jtxB3abRynX77zzK6Lk9gLwbQXKTiv7 KHOw== 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:in-reply-to :references; bh=kMPZfG0/lxrDyy6q8qY41nJeI4N2npqyyqxYt1MRKRI=; b=aPbGw9QYjBg6Aw3H4Ge/J/RYgC1uCurYnUy2K9COhycufTJtDk9GvfvnXTOcXl4PMG /LO6RSiR81dcerx0NNDc9l9end1t5V7ig8Exirxu/OuFL0789Y3rduwXru13CQwr39jR oUFYmo2Ftw/1GulU4k3uorGQsNdbOzoXN3+DJPSTtMhQju3Zn1I2Xmb9IfmN7+rOchfZ DVRDyPRQL7Ob9iQEfIQymJaLTNFs+BswDncT4k76xTmSy5iv1MGzu42d0acfXd0wYMe1 qnHwjta2pAqVu8quR87e9vdCCg+JyTc//Tq5MRHq4TrXCXpsNbGV2WMkpOmObsDS/ml/ xhLQ== X-Gm-Message-State: AKwxytfsirf/7ywaXt3FlPsxs1TOjRPnYy3arLEXnRnHlHcjp+DRuupM kLsFnUiDj4bLMJCm+vnJEM/32Q== X-Google-Smtp-Source: AH8x225Kxa/0ruTzSRuYiLv6zhwvB2I4kHi6e7WfDi7yJ5XnipBX9LHqIsrCtFxeAeVJ3FiaQTynxg== X-Received: by 2002:a17:902:824:: with SMTP id 33-v6mr37907826plk.258.1517709051520; Sat, 03 Feb 2018 17:50:51 -0800 (PST) Received: from localhost.localdomain (p4a0ad0.kngwnt01.ap.so-net.ne.jp. [120.74.10.208]) by smtp.gmail.com with ESMTPSA id b8sm10045553pff.31.2018.02.03.17.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Feb 2018 17:50:50 -0800 (PST) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH v2 2/2] dbus: Add FILS capability Date: Sun, 4 Feb 2018 10:50:37 +0900 Message-Id: <1517709037-5015-2-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517709037-5015-1-git-send-email-masashi.honma@gmail.com> References: <1515383840-7921-1-git-send-email-masashi.honma@gmail.com> <1517709037-5015-1-git-send-email-masashi.honma@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c01:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masashi Honma MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Masashi Honma --- wpa_supplicant/ctrl_iface.c | 40 +++++---------------------------- wpa_supplicant/dbus/dbus_new_handlers.c | 17 +++++++++++++- wpa_supplicant/wpa_supplicant.c | 29 ++++++++++++++++++++++++ wpa_supplicant/wpa_supplicant_i.h | 3 +++ 4 files changed, 53 insertions(+), 36 deletions(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 9ad39b8..b6755bc 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -64,28 +64,6 @@ static int * freq_range_to_channel_list(struct wpa_supplicant *wpa_s, char *val); -#ifdef CONFIG_FILS - -static int wpa_is_fils_supported(struct wpa_supplicant *wpa_s) -{ - return (((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) && - (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_FILS)) || - (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) && - (wpa_s->drv_flags & WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD))); -} - - -#ifdef CONFIG_FILS_SK_PFS -static int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s) -{ - return (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) && - (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_FILS); -} -#endif /* CONFIG_FILS_SK_PFS */ - -#endif /* CONFIG_FILS */ - - static int set_bssid_filter(struct wpa_supplicant *wpa_s, char *val) { char *pos; @@ -4093,8 +4071,7 @@ static int ctrl_iface_get_capability_auth_alg(struct wpa_supplicant *wpa_s, } #endif /* CONFIG_SAE */ -#ifdef CONFIG_FILS - if (wpa_is_fils_supported(wpa_s)) { + if (wpas_is_fils_supported(wpa_s)) { ret = os_snprintf(pos, end - pos, "%sFILS_SK_WITHOUT_PFS", pos == buf ? "" : " "); if (os_snprintf_error(end - pos, ret)) @@ -4102,16 +4079,13 @@ static int ctrl_iface_get_capability_auth_alg(struct wpa_supplicant *wpa_s, pos += ret; } -#ifdef CONFIG_FILS_SK_PFS - if (wpa_is_fils_sk_pfs_supported(wpa_s)) { + if (wpas_is_fils_sk_pfs_supported(wpa_s)) { ret = os_snprintf(pos, end - pos, "%sFILS_SK_WITH_PFS", pos == buf ? "" : " "); if (os_snprintf_error(end - pos, ret)) return pos - buf; pos += ret; } -#endif /* CONFIG_FILS_SK_PFS */ -#endif /* CONFIG_FILS */ return pos - buf; } @@ -4370,26 +4344,22 @@ static int wpa_supplicant_ctrl_iface_get_capability( } #endif /* CONFIG_ACS */ -#ifdef CONFIG_FILS if (os_strcmp(field, "fils") == 0) { -#ifdef CONFIG_FILS_SK_PFS - if (wpa_is_fils_supported(wpa_s) && - wpa_is_fils_sk_pfs_supported(wpa_s)) { + if (wpas_is_fils_supported(wpa_s) && + wpas_is_fils_sk_pfs_supported(wpa_s)) { res = os_snprintf(buf, buflen, "FILS FILS-SK-PFS"); if (os_snprintf_error(buflen, res)) return -1; return res; } -#endif /* CONFIG_FILS_SK_PFS */ - if (wpa_is_fils_supported(wpa_s)) { + if (wpas_is_fils_supported(wpa_s)) { res = os_snprintf(buf, buflen, "FILS"); if (os_snprintf_error(buflen, res)) return -1; return res; } } -#endif /* CONFIG_FILS */ wpa_printf(MSG_DEBUG, "CTRL_IFACE: Unknown GET_CAPABILITY field '%s'", field); diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index e31b733..90bf0d9 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -980,9 +980,20 @@ dbus_bool_t wpas_dbus_getter_global_capabilities( const struct wpa_dbus_property_desc *property_desc, DBusMessageIter *iter, DBusError *error, void *user_data) { - const char *capabilities[5] = { NULL, NULL, NULL, NULL, NULL }; + struct wpa_global *global = user_data; + struct wpa_supplicant *wpa_s; + int fils_supported = 0, fils_sk_pfs_supported = 0; + const char *capabilities[7] = { NULL, NULL, NULL, NULL, NULL, NULL, + NULL }; size_t num_items = 0; + for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) { + if (wpas_is_fils_supported(wpa_s)) + fils_supported = 1; + if (wpas_is_fils_sk_pfs_supported(wpa_s)) + fils_sk_pfs_supported = 1; + } + #ifdef CONFIG_AP capabilities[num_items++] = "ap"; #endif /* CONFIG_AP */ @@ -998,6 +1009,10 @@ dbus_bool_t wpas_dbus_getter_global_capabilities( #ifdef CONFIG_IEEE80211W capabilities[num_items++] = "pmf"; #endif /* CONFIG_IEEE80211W */ + if (fils_supported) + capabilities[num_items++] = "fils"; + if (fils_sk_pfs_supported) + capabilities[num_items++] = "fils_sk_pfs"; return wpas_dbus_simple_array_property_getter(iter, DBUS_TYPE_STRING, diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 4209c41..dc5ce73 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2337,6 +2337,35 @@ static size_t wpas_add_fils_hlp_req(struct wpa_supplicant *wpa_s, u8 *ie_buf, return ie_len; } + + +int wpas_is_fils_supported(struct wpa_supplicant *wpa_s) +{ + return (((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) && + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_FILS)) || + (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) && + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD))); +} + + +int wpas_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s) +{ +#ifdef CONFIG_FILS_SK_PFS + return (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) && + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_FILS); +#else /* CONFIG_FILS_SK_PFS */ + return 0; +#endif /* CONFIG_FILS_SK_PFS */ +} +#else /* CONFIG_FILS */ +int wpas_is_fils_supported(struct wpa_supplicant *wpa_s) +{ + return 0; +} +int wpas_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s) +{ + return 0; +} #endif /* CONFIG_FILS */ diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index b154d3e..4a735ae 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1474,4 +1474,7 @@ int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s, unsigned int *num, unsigned int *freq_list); +int wpas_is_fils_supported(struct wpa_supplicant *wpa_s); +int wpas_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s); + #endif /* WPA_SUPPLICANT_I_H */