From patchwork Sat Sep 28 18:18:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Wetzel X-Patchwork-Id: 1168885 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=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=quarantine dis=none) header.from=wetzel-home.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DWO9zSag"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=wetzel-home.de header.i=@wetzel-home.de header.b="jtNwI7uq"; 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 46gcQs5rBDz9sPQ for ; Sun, 29 Sep 2019 04:20:21 +1000 (AEST) 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: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=4rruGSPBG1YzZY/9URSNGTQCGl7oz3c5Sz8SxLj/zNI=; b=DWO9zSag+AQ8Jw Hbf6j5Sq0sCZ/Ap0VjhhcKCNqwzUSP0muUINDknc5vNKGsRpOUbu5HR+tkTa0YuJu6IhSDkp6PMD7 lXrnCyQ85zQ5CUalGaxH5U7jRbxjlNZQ4M3Y9Vwqw7SfBFALl8cs2nL43AzES6r+cg9ExDTEh3y8b /uBk5D8feBqt+pq7WQT9Eic8ISgeQ2UgvLlswm4cw4ZwAXohTovK4SgKi/dIOrzjf/bS8qjDQXhtv +xFPEG4O5hzMROS18x8N9+HKUeQu8TK75fJkLhQTf+QBTxliRIB7RKDjIOXXTDAwKIHZvrqJCAZs9 JztMTUTJoGmR8CmjjITA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iEHKL-0003Ar-KQ; Sat, 28 Sep 2019 18:20:17 +0000 Received: from 19.mo4.mail-out.ovh.net ([87.98.179.66]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iEHJL-00010e-Se for hostap@lists.infradead.org; Sat, 28 Sep 2019 18:19:19 +0000 Received: from player738.ha.ovh.net (unknown [10.109.143.249]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id 0FE8F207EAF for ; Sat, 28 Sep 2019 20:19:11 +0200 (CEST) Received: from awhome.eu (p4FF9144D.dip0.t-ipconnect.de [79.249.20.77]) (Authenticated sender: postmaster@awhome.eu) by player738.ha.ovh.net (Postfix) with ESMTPSA id 929DEA75DF0C; Sat, 28 Sep 2019 18:19:08 +0000 (UTC) From: Alexander Wetzel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1569694743; bh=NZmF35SU3rrFG5I/22hRtPnXE5V3z1t0MqYFW0TRHTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jtNwI7uqOiZsP0Vn778Td4qoSaTKLl2sGEKMV6YeCo32dT63cXltj2MiTpoNUjPii ed+gmrA2q52leHNuUKma5I6qztboCqe1JAxUJDQGZndNNUjPk1XU+P0B1VhFpNaazd Vgn3CwbbmdcNJRdQduq3sdDnQu36OJr60PytuqYk= To: j@w1.fi Subject: [PATCH v6a 6/7] Fixes for tests: Extended Key ID tests Date: Sat, 28 Sep 2019 20:18:06 +0200 Message-Id: <20190928181807.180530-7-alexander@wetzel-home.de> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190928181807.180530-1-alexander@wetzel-home.de> References: <20190928181807.180530-1-alexander@wetzel-home.de> MIME-Version: 1.0 X-Ovh-Tracer-Id: 11826171147899641084 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrfeekgdduvddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenuc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190928_111916_063371_7CFC7DA6 X-CRM114-Status: GOOD ( 10.44 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 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 [87.98.179.66 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [87.98.179.66 listed in wl.mailspike.net] -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 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.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 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: Alexander Wetzel , hostap@lists.infradead.org, luca@coelho.fi, johannes@sipsolutions.net Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This is a correction on top of: [PATCH v6 12/17] tests: Extended Key ID tests Changes: - Verify a TKIP only AP is not using Extended Key ID. - Tune the Extended Key ID detection - Adaptions to the log behavior changes by another patch (Fixes for hostapd: Add support for Extended Key ID) Signed-off-by: Alexander Wetzel --- tests/hwsim/hostapd.py | 13 ++++++------- tests/hwsim/test_ap_psk.py | 10 ++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index c8021ffcc..d6d0bed37 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -555,17 +555,16 @@ def add_ap(apdev, params, wait_enabled=True, no_enable=False, timeout=30, return hapd hapd.enable() if wait_enabled: - if "wpa" in params and params["wpa"] == "2": - ev = hapd.wait_event(["Extended Key ID"], timeout=5) - if ev is None or "requires wpa2" in ev: - hapd.extKeyID = "unused" - elif "not supported" in ev: + ev = hapd.wait_event(["Extended Key ID", + "AP-ENABLED", "AP-DISABLED"], timeout=timeout) + if "Extended Key ID" in ev: + if "not supported" in ev: hapd.extKeyID = "auto-off" - elif "disabled" in ev: + elif "support disabled" in ev: hapd.extKeyID = "force-off" else: hapd.extKeyID = "auto-on" - ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=timeout) + ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=timeout) if ev is None: raise Exception("AP startup timed out") if "AP-ENABLED" not in ev: diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index 78dc7a662..6be9b19f8 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -3377,6 +3377,16 @@ def test_ap_wpa2_ptk_extended_key_id_compat_sta(dev, apdev): dev[0].reset() def test_ap_wpa2_ptk_extended_key_id_tkip(dev, apdev): + """Extended Key ID with TKIP only AP""" + ssid = "test-wpa2-psk" + passphrase = 'qwertyuiop' + params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase) + params["rsn_pairwise"] = "TKIP" + hapd = hostapd.add_ap(apdev[0], params) + if hapd.extKeyID != "force-off": + raise Exception("Extended Key ID support not disabled for TKIP only AP") + +def test_ap_wpa2_ptk_extended_key_id_tkip_sta(dev, apdev): """Extended Key ID WPA2-PSK AP and station using WPA2 with TKIP only""" ssid = "test-wpa2-psk" passphrase = 'qwertyuiop'