From patchwork Mon Aug 6 19:46:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathy Vanhoef X-Patchwork-Id: 954196 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=none (p=none dis=none) header.from=cs.kuleuven.be Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gF7vDaoc"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::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 41kpDF3hCkz9ryt for ; Tue, 7 Aug 2018 05:50:53 +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: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=Tj0IM6XkWmj5MKaF4op8RQHoLPgxjHaFGj6PkQT/eBU=; b=gF7vDaoc7XinEJNKgXQIZ6wcMf VO2aCTcDZRgjo+wr2LEYbcw1UcDRQMOQGcA/vrvTHxpZXKwEWspCKSMf0+0ly5r801iTFkBqEY3+1 +xqKPt3tar8J2X8v0+dkKr5FtsnlqH75conMZFL6U8CJESlKV/ZfDSd+XX0N5w1kXOtWfW0loCDDW nCRDog3Di6X0Qkk/F4lUMzDCmSmSops3wUL4RI9wN4dnyRyPuTBQLfWpORPqgula++uI2ofvI7ccj y3MPdxapX2DIe5JloWh8aFJfJVWaP6HRPgXr/ht9D5U5RbcEzq27sPsJW1cWdvSuW24oRNN4imRwG Af1nvjTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmlWi-0000s7-ER; Mon, 06 Aug 2018 19:50:48 +0000 Received: from vmailrelay1.cs.kuleuven.be ([2a02:2c40:0:a000::118] helo=hermes4.cs.kuleuven.be) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmlVl-0007Bx-Ul for hostap@lists.infradead.org; Mon, 06 Aug 2018 19:49:55 +0000 Received: from dr-zook.cs.kuleuven.be. (vdr-zook1.cs.kuleuven.be [IPv6:2a02:2c40:500:a005::12c]) by hermes4.cs.kuleuven.be. with ESMTP id w76JjNEY018653 for ; Mon, 6 Aug 2018 21:45:23 +0200 Received: from localhost (localhost [127.0.0.1]) by dr-zook.cs.kuleuven.be. (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w76JiZHE020772 for ; Mon, 6 Aug 2018 21:45:23 +0200 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dr-zook.cs.kuleuven.be. X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Virus-Scanned: Debian amavisd-new at dr-zook.cs.kuleuven.be Received: from dr-zook.cs.kuleuven.be. ([127.0.0.1]) by localhost (dr-zook.cs.kuleuven.be [127.0.0.1]) (amavisd-new, port 10023) with LMTP id lMEZ0PXG8jLb for ; Mon, 6 Aug 2018 21:45:16 +0200 (CEST) Received: from oryx.cs.kuleuven.be. (mail4.cs.kuleuven.be [IPv6:2a02:2c40:0:a000::122]) by dr-zook.cs.kuleuven.be. (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w76Jj7jw020872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Aug 2018 21:45:08 +0200 Received: from localhost.localdomain (ip-83-134-207-58.dsl.scarlet.be [83.134.207.58]) (authenticated bits=0) by oryx.cs.kuleuven.be. (A_Good_MTA/8.14.4/Debian-4.1ubuntu1) with ESMTP id w76Jhl98019837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 6 Aug 2018 21:45:07 +0200 From: Maty Vanhoef To: hostap@lists.infradead.org Subject: [PATCH 25/25] OCV: Test OCI validation in the AMPE handshake Date: Mon, 6 Aug 2018 15:46:43 -0400 Message-Id: <20180806194643.1328-26-Mathy.Vanhoef@cs.kuleuven.be> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180806194643.1328-1-Mathy.Vanhoef@cs.kuleuven.be> References: <20180806194643.1328-1-Mathy.Vanhoef@cs.kuleuven.be> X-Scanned-By: MIMEDefang 2.73 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180806_124950_963806_D75FC41D X-CRM114-Status: GOOD ( 10.42 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 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: Maty Vanhoef MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Mathy Vanhoef --- tests/hwsim/test_wpas_mesh.py | 103 +++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py index 5feb9bee5..31c11e26e 100644 --- a/tests/hwsim/test_wpas_mesh.py +++ b/tests/hwsim/test_wpas_mesh.py @@ -305,7 +305,7 @@ def _test_mesh_open_rssi_threshold(dev, apdev, value, expected): ": " + str(mesh_rssi_threshold)) def add_mesh_secure_net(dev, psk=True, pmf=False, pairwise=None, group=None, - sae_password=False, sae_password_id=None): + sae_password=False, sae_password_id=None, ocv=False): id = dev.add_network() dev.set_network(id, "mode", "5") dev.set_network_quoted(id, "ssid", "wpas-mesh-sec") @@ -323,6 +323,8 @@ def add_mesh_secure_net(dev, psk=True, pmf=False, pairwise=None, group=None, dev.set_network(id, "pairwise", pairwise) if group: dev.set_network(id, "group", group) + if ocv: + dev.set_network(id, "ocv", "1") return id def test_wpas_mesh_secure(dev, apdev): @@ -437,6 +439,105 @@ def test_mesh_secure_pmf(dev, apdev): # Test connectivity 0->1 and 1->0 hwsim_utils.test_connectivity(dev[0], dev[1]) +def test_mesh_secure_ocv(dev, apdev): + """Secure mesh network connectivity with OCV enabled""" + check_mesh_support(dev[0], secure=True) + dev[0].request("SET sae_groups ") + id = add_mesh_secure_net(dev[0], pmf=True, ocv=True) + dev[0].mesh_group_add(id) + dev[1].request("SET sae_groups ") + id = add_mesh_secure_net(dev[1], pmf=True, ocv=True) + dev[1].mesh_group_add(id) + + # Check for mesh joined + check_mesh_group_added(dev[0]) + check_mesh_group_added(dev[1]) + + # Check for peer connected + check_mesh_peer_connected(dev[0]) + check_mesh_peer_connected(dev[1]) + + # Test connectivity 0->1 and 1->0 + hwsim_utils.test_connectivity(dev[0], dev[1]) + +def test_mesh_secure_ocv_compat(dev, apdev): + """Secure mesh network where only one peer has OCV enabled""" + check_mesh_support(dev[0], secure=True) + dev[0].request("SET sae_groups ") + id = add_mesh_secure_net(dev[0], pmf=True, ocv=True) + dev[0].mesh_group_add(id) + dev[1].request("SET sae_groups ") + id = add_mesh_secure_net(dev[1], pmf=True, ocv=False) + dev[1].mesh_group_add(id) + + # Check for mesh joined + check_mesh_group_added(dev[0]) + check_mesh_group_added(dev[1]) + + # Check for peer connected + check_mesh_peer_connected(dev[0]) + check_mesh_peer_connected(dev[1]) + + # Test connectivity 0->1 and 1->0 + hwsim_utils.test_connectivity(dev[0], dev[1]) + +def test_mesh_secure_ocv_mix_legacy(dev, apdev): + """Mesh network with a VHT STA and a legacy STA under OCV""" + subprocess.call(['iw', 'reg', 'set', 'AZ']) + + check_mesh_support(dev[0], secure=True) + dev[0].request("SET sae_groups ") + id = add_mesh_secure_net(dev[0], pmf=True, ocv=True) + dev[0].set_network(id, "frequency", "5200") + dev[0].set_network(id, "max_oper_chwidth", "2") + dev[0].mesh_group_add(id) + + dev[1].request("SET sae_groups ") + id = add_mesh_secure_net(dev[1], pmf=True, ocv=True) + dev[1].set_network(id, "frequency", "5200") + dev[1].set_network(id, "disable_vht", "1") + dev[1].set_network(id, "disable_ht40", "1") + dev[1].mesh_group_add(id) + + # Check for mesh joined + check_mesh_group_added(dev[0]) + check_mesh_group_added(dev[1]) + + # Check for peer connected + check_mesh_peer_connected(dev[0]) + check_mesh_peer_connected(dev[1]) + + # Test connectivity 0->1 and 1->0 + hwsim_utils.test_connectivity(dev[0], dev[1]) + +def test_mesh_secure_ocv_mix_ht(dev, apdev): + """Mesh network with a VHT STA and a HT STA under OCV""" + subprocess.call(['iw', 'reg', 'set', 'AZ']) + + check_mesh_support(dev[0], secure=True) + dev[0].request("SET sae_groups ") + id = add_mesh_secure_net(dev[0], pmf=True, ocv=True) + dev[0].set_network(id, "frequency", "5200") + dev[0].set_network(id, "max_oper_chwidth", "2") + dev[0].mesh_group_add(id) + + dev[1].request("SET sae_groups ") + id = add_mesh_secure_net(dev[1], pmf=True, ocv=True) + dev[1].set_network(id, "frequency", "5200") + dev[1].set_network(id, "disable_vht", "1") + dev[1].mesh_group_add(id) + + # Check for mesh joined + check_mesh_group_added(dev[0]) + check_mesh_group_added(dev[1]) + + # Check for peer connected + check_mesh_peer_connected(dev[0]) + check_mesh_peer_connected(dev[1]) + + # Test connectivity 0->1 and 1->0 + hwsim_utils.test_connectivity(dev[0], dev[1]) + def run_mesh_secure(dev, cipher): if cipher not in dev[0].get_capability("pairwise"): raise HwsimSkip("Cipher %s not supported" % cipher)