From patchwork Wed Mar 2 22:26:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 1600123 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Y9FnFRqE; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=GG5Hp0+f; dkim-atps=neutral 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=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4K89Y15TDlz9s1l for ; Thu, 3 Mar 2022 10:38:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7jceaEtK/I0ZL8F4TI4+8EgHcRTAKZXsgFwZ6ZSzzvc=; b=Y9FnFRqEszSmeq 5giGcr1JUOrAzKd1sQlwjta1Nf+8NYhNkAV1fkoie0Uy10OOVE24hvJkh4EhVlyadZpMfyYhMifl7 kl0r1uC+C1DE3/Ndd67HG5JgkA9Xy7IKkTY05HuSYpNChrjATrYKZK+Xuy0WWb93K4gGBXo5j9lwU 5Qc/mEryvahcmU9bzwQUouYYVlBUwrBtGEzwHb4JueJ/1ENS/lVB3SO6WNT7dtXIxFypyhb4v8vTD 3doNaoEN9Y23/1Go4AV0OK3hghp9sZnYZUWMr1l9Wv40LzRS+vUVDxk/G1bysoxv8BBwgIbBcbLnR Bm8rWyys+wn1iGIwuf4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPYX6-004ipA-Qf; Wed, 02 Mar 2022 23:37:25 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPXRC-004Ylt-R4 for hostap@lists.infradead.org; Wed, 02 Mar 2022 22:27:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646260035; x=1677796035; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=AlEbFAvI0fgritSAznCMNG9nbpvdPs1SQCUB543lO/s=; b=GG5Hp0+frtqjDV5Cz5VCyELi+y/pNYjrEmo70apHoDcHLiGOdWKFEGDB vJGi0XjlT1aB81Y9BQn5E+PbLq2zs7ZSd/oqowpO6dzE1nt2z8xcENvSr A838uHCoCbYVr8VtLyidBbDSY7vfGwoDqUZ8OCwd0x41RTkTPz6dt4sL7 c=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 02 Mar 2022 14:27:06 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 14:27:06 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Wed, 2 Mar 2022 14:26:48 -0800 Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Wed, 2 Mar 2022 14:26:48 -0800 From: Aloka Dixit To: , Subject: [PATCH 11/13] mbssid: hidden SSID support Date: Wed, 2 Mar 2022 14:26:32 -0800 Message-ID: <20220302222634.22185-12-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302222634.22185-1-quic_alokad@quicinc.com> References: <20220302222634.22185-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220302_142715_006382_2E529766 X-CRM114-Status: GOOD ( 16.14 ) X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hidden nontransmitted BSSID profiles will be included in the beacons and probe responses but SSID value will be removed or set to all zeros depending on the configured value of 'ignore_broadcast_ssid' [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [129.46.98.28 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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 -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Mailman-Approved-At: Wed, 02 Mar 2022 15:34:45 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hidden nontransmitted BSSID profiles will be included in the beacons and probe responses but SSID value will be removed or set to all zeros depending on the configured value of 'ignore_broadcast_ssid'. If complete profiles are omitted, clients cannot stay connected to the AP. For unicast probe requests with SSID set to a hidden nontransmitted BSS, complete SSID should be included in the response. Co-developed-by: Sowmiya Sree Elavalagan Signed-off-by: Sowmiya Sree Elavalagan Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 25 +++++++++++++++++++------ src/ap/ieee802_11.c | 24 +++++++++++++++++++----- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index be0f0658155a..5f22dfc8cde2 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -547,6 +547,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, struct ieee80211_mgmt *resp; u8 *pos, *epos, *csa_pos, *ext_cap_pos; size_t buflen; + struct hostapd_data *hapd_probed = hapd; hapd = hostapd_mbssid_get_tx_bss(hapd); @@ -584,7 +585,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, } #endif /* CONFIG_IEEE80211AX */ - buflen += hostapd_eid_mbssid_len(hapd, WLAN_FC_STYPE_PROBE_RESP, NULL); + buflen += hostapd_eid_mbssid_len(hapd_probed, WLAN_FC_STYPE_PROBE_RESP, + NULL); buflen += hostapd_eid_rnr_len(hapd, WLAN_FC_STYPE_PROBE_RESP); buflen += hostapd_mbo_ie_len(hapd); buflen += hostapd_eid_owe_trans_len(hapd); @@ -612,9 +614,20 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = resp->u.probe_resp.variable; *pos++ = WLAN_EID_SSID; - *pos++ = hapd->conf->ssid.ssid_len; - os_memcpy(pos, hapd->conf->ssid.ssid, hapd->conf->ssid.ssid_len); - pos += hapd->conf->ssid.ssid_len; + if (hapd->conf->ignore_broadcast_ssid && hapd != hapd_probed) { + if (hapd->conf->ignore_broadcast_ssid == 2) { + *pos++ = hapd->conf->ssid.ssid_len; + os_memset(pos, 0, hapd->conf->ssid.ssid_len); + pos += hapd->conf->ssid.ssid_len; + } else { + *pos++ = 0; /* empty SSID */ + } + } else { + *pos++ = hapd->conf->ssid.ssid_len; + os_memcpy(pos, hapd->conf->ssid.ssid, + hapd->conf->ssid.ssid_len); + pos += hapd->conf->ssid.ssid_len; + } /* Supported rates */ pos = hostapd_eid_supp_rates(hapd, pos); @@ -653,8 +666,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = hostapd_eid_supported_op_classes(hapd, pos); pos = hostapd_eid_ht_capabilities(hapd, pos); pos = hostapd_eid_ht_operation(hapd, pos); - pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0, - NULL); + pos = hostapd_eid_mbssid(hapd_probed, pos, epos, + WLAN_FC_STYPE_PROBE_RESP, 0, NULL); ext_cap_pos = pos; pos = hostapd_eid_ext_capab(hapd, pos); diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 3365b48fa639..36d6831b2376 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -7490,11 +7490,16 @@ static size_t hostapd_eid_mbssid_elem_len(struct hostapd_data *hapd, * Sublement ID: 1 byte * Length: 1 byte * Nontransmitted capabilities: 4 bytes - * SSID element: 2 + variable + * SSID element: 2 + variable (except for hidden BSS) * Multiple BSSID Index Element: 3 bytes (+2 bytes in beacons) * Fixed length = 1 + 1 + 4 + 2 + 3 = 11 */ - nontx_profile_len = 11 + bss->conf->ssid.ssid_len; + nontx_profile_len = 11; + + if (!bss->conf->ignore_broadcast_ssid || + bss->conf->ignore_broadcast_ssid == 2 || + (frame_type == WLAN_FC_STYPE_PROBE_RESP && bss == hapd)) + nontx_profile_len += bss->conf->ssid.ssid_len; if (frame_type == WLAN_FC_STYPE_BEACON) nontx_profile_len += 2; @@ -7593,9 +7598,18 @@ static u8 * hostapd_eid_mbssid_elem(struct hostapd_data *hapd, u8 *eid, u8 *end, eid += sizeof(capab_info); *eid++ = WLAN_EID_SSID; - *eid++ = conf->ssid.ssid_len; - os_memcpy(eid, conf->ssid.ssid, conf->ssid.ssid_len); - eid += conf->ssid.ssid_len; + if (!conf->ignore_broadcast_ssid || + (frame_type == WLAN_FC_STYPE_PROBE_RESP && bss == hapd)) { + *eid++ = conf->ssid.ssid_len; + os_memcpy(eid, conf->ssid.ssid, conf->ssid.ssid_len); + eid += conf->ssid.ssid_len; + } else if (conf->ignore_broadcast_ssid == 2) { + *eid++ = conf->ssid.ssid_len; + os_memset(eid, 0, conf->ssid.ssid_len); + eid += conf->ssid.ssid_len; + } else { + *eid++ = 0; + } *eid++ = WLAN_EID_MULTIPLE_BSSID_INDEX; if (frame_type == WLAN_FC_STYPE_BEACON) {