From patchwork Wed Oct 25 11:51:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: huw@codeaurora.org X-Patchwork-Id: 831258 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="JCYerYHX"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="GV5oldI6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="GV5oldI6"; 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 3yNhCM06Yfz9t0F for ; Fri, 27 Oct 2017 22:16:31 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:Subject:To:From:Date:MIME-Version: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WPg8IuY9aNPPTSXZoAOd7oQ/jKZ/dcTh9bjlmqI4gLw=; b=JCYerYHXfTwNSS HNwRZQ5TsT4dHyHXaJek9nVdr0Ub5tMVP+nlaIiFPktf1MoG28U++SExSJjssrsM0LZfISNjUX/AH hkjOlzL2E/z5aZod7bCShiaKI98l295n90LSCdZad9lP/+rYh+R8NBLJuV8emVq01L2VjVgCaDORe B6Q5nWuYNDA6NIEK4DnUpXoi4Si+O1+/M+odzZiL+rQ8qacUdP6E50liG0HC3YSkoa6exD3nFRQzJ VWimGjbApzhlzaHgsLO0RMlLvNi+h1xvmZw2GFAeaQsKt8xm4+tbIJi3C9kJQar+2SXR9F2Pf774P NLDHLiudxLKmCZAySskg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e82cn-0008Ln-3c; Fri, 27 Oct 2017 11:16:29 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e7KDb-0002N9-0n for hostap@lists.infradead.org; Wed, 25 Oct 2017 11:51:32 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E8FDE606B7; Wed, 25 Oct 2017 11:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1508932269; bh=qgUmEKo5EsGx3NpZEqvEguWJXsTPG+Vk/hqDe1kbxOE=; h=Date:From:To:Subject:From; b=GV5oldI6PYx57UXCACoKwv03uhSzaKs29Xm01te4CtlJwLxHJD3L1xvcg+XFhkLva oCMCLllxgEUxliC9TEGV3XfeouMDlNPepvmrqiPT4fPiV/r1b5Z6K2orXejolSsm4+ AjBJzUV4iY2zer8XmEgytKafNQEx99gBDGnVMXK8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 774E0601EA for ; Wed, 25 Oct 2017 11:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1508932269; bh=qgUmEKo5EsGx3NpZEqvEguWJXsTPG+Vk/hqDe1kbxOE=; h=Date:From:To:Subject:From; b=GV5oldI6PYx57UXCACoKwv03uhSzaKs29Xm01te4CtlJwLxHJD3L1xvcg+XFhkLva oCMCLllxgEUxliC9TEGV3XfeouMDlNPepvmrqiPT4fPiV/r1b5Z6K2orXejolSsm4+ AjBJzUV4iY2zer8XmEgytKafNQEx99gBDGnVMXK8= MIME-Version: 1.0 Date: Wed, 25 Oct 2017 19:51:09 +0800 From: huw@codeaurora.org To: hostap@lists.infradead.org Subject: [PATCH] hostapd: Disassoc STA without WPA/RSN IE if AP proto is WPA/RSN Message-ID: <41b1fefe9ea4e9ed0e817ec64bdb3b4e@codeaurora.org> X-Sender: huw@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171025_045131_091126_FD2CAF97 X-CRM114-Status: UNSURE ( 4.75 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.3 (----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-4.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [198.145.29.96 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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_AU Message has a valid DKIM or DK signature from author's domain X-Mailman-Approved-At: Fri, 27 Oct 2017 04:16:23 -0700 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: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Author: Hu Wang Date: Wed Oct 25 19:41:00 2017 +0800 hostapd: Disassoc STA without WPA/RSN IE if AP proto is WPA/RSN With the AP proto configured being WPA/RSN and SME in the driver, the current implementation in hostapd is to not process hostapd_notif_assoc due to "No WPA/RSN IE from STA", if the (Re)Association request frame is without the WPA/RSN IE's. Enhance the current implementation to disassoc such station, provided the AP is not in WPS. Signed-off-by: Hu Wang if (hapd->conf->wps_state && ie[0] == 0xdd && ie[1] >= 4 && diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index ffa8bf1..944f155 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -262,7 +262,8 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, #endif /* CONFIG_WPS */ wpa_printf(MSG_DEBUG, "No WPA/RSN IE from STA"); - return -1; + reason = WLAN_REASON_INVALID_IE; + goto fail; } #ifdef CONFIG_WPS