From patchwork Mon Aug 6 19:46:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathy Vanhoef X-Patchwork-Id: 954206 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="ZE0da5lt"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="BZyfXvxF"; 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 41kpGJ2fcBz9ryt for ; Tue, 7 Aug 2018 05:52:40 +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=PfrOapQ45DO/8kMtdf6QLyjUHTXzJGGxd/WkpqdM4b0=; b=ZE0da5ltDMvcCgopwOyfISvaAC w9icEj1mpITA7O7wMbC/EQIlDsw/1x6AWrigiOSghx2flLT1J+XDiNXDaFxiOMTTD7JT9/mxDP50J 25ymR8Z76ycC8Z5Nc60tZVauQf6xVTiSe+TO/9w3TXhzmiIxsEIIBMimRMqj8Ko06iXHy0d/n/Agf Pqu+aLWa2+yZpg9vV7zPi+TSucB22yaRPqCe6taV8ZTCmWIwQ1vG94EUXWZDGjPxC/fsmcvhokq/c Pu+rBz06yxNFps34PgvdAdoD5aOGPwhpVgY0Bc5OA6y9qs7H9o1/kwhPAKsFYwuWBXXXsZGLvL17W kcVcJSrQ==; 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 1fmlYR-0003vg-21; Mon, 06 Aug 2018 19:52:35 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmlXy-0002z5-Pc for hostap@bombadil.infradead.org; Mon, 06 Aug 2018 19:52:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=h7EzEoWdq0cRc8Nj/YndFLhRMAsLb5b53sRlGneULlE=; b=BZyfXvxF+CYIRMAMxbJDktBgJ 0Ox9sSatz1IhVFT2JPjNenbDQtAZsaD7n6zoQdQ9sAA+p47FbQgUj17kS88y4ABN3bMk1A5JQzZoe zOsqDEeRC5u7UR1++T2/AU4LoqtruCBES+Co0CiCLDhD5eF2cpktlR1VE5qG1lHaATzkMgQOq4fdl dR8ERnwVR3jTK3e68ilq5JGnt5HIqc4/X1xt1CHiTvjCY+Kl2hGBBr7bAuzicubNKjl8AjV5DZT3s 9mqsA/WtjizZDL/+g0PgzNo9v44E3NXWxQK0cQBXXtUJqhb80JAtKZddPQ++pOeC3OAnJMkwiSN0I FExc4cUeg==; Received: from vmailrelay1.cs.kuleuven.be ([2a02:2c40:0:a000::118] helo=hermes4.cs.kuleuven.be) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmlXw-0003YK-7v for hostap@lists.infradead.org; Mon, 06 Aug 2018 19:52:05 +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 w76JjE1F018640 for ; Mon, 6 Aug 2018 21:45:14 +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 w76JisNC020819 for ; Mon, 6 Aug 2018 21:45:14 +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 JafvfxPNF2NE for ; Mon, 6 Aug 2018 21:45:06 +0200 (CEST) Received: from oryx.cs.kuleuven.be. (oryx.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 w76JiwUZ020841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 6 Aug 2018 21:44:58 +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 w76Jhl95019837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 6 Aug 2018 21:44:58 +0200 From: Maty Vanhoef To: hostap@lists.infradead.org Subject: [PATCH 22/25] OCV: Test OCI validation in the FILS handshake Date: Mon, 6 Aug 2018 15:46:40 -0400 Message-Id: <20180806194643.1328-23-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_155204_489696_486E2FFC X-CRM114-Status: GOOD ( 10.68 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.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_fils.py | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/hwsim/test_fils.py b/tests/hwsim/test_fils.py index 2d531a636..b5017c506 100644 --- a/tests/hwsim/test_fils.py +++ b/tests/hwsim/test_fils.py @@ -181,6 +181,62 @@ def test_fils_sk_pmksa_caching(dev, apdev, params): time.sleep(0.1) hwsim_utils.test_connectivity(dev[0], hapd) +def test_fils_sk_pmksa_caching_ocv(dev, apdev, params): + """FILS SK and PMKSA caching""" + check_fils_capa(dev[0]) + check_erp_capa(dev[0]) + + start_erp_as(apdev[1], msk_dump=os.path.join(params['logdir'], "msk.lst")) + + bssid = apdev[0]['bssid'] + params = hostapd.wpa2_eap_params(ssid="fils") + params['wpa_key_mgmt'] = "FILS-SHA256" + params['auth_server_port'] = "18128" + params['erp_domain'] = 'example.com' + params['fils_realm'] = 'example.com' + params['ieee80211w'] = '1' + params['ocv'] = '1' + hapd = hostapd.add_ap(apdev[0]['ifname'], params) + + dev[0].scan_for_bss(bssid, freq=2412) + dev[0].request("ERP_FLUSH") + id = dev[0].connect("fils", key_mgmt="FILS-SHA256", + eap="PSK", identity="psk.user@example.com", + password_hex="0123456789abcdef0123456789abcdef", + erp="1", scan_freq="2412", ieee80211w="1", ocv="1") + pmksa = dev[0].get_pmksa(bssid) + if pmksa is None: + raise Exception("No PMKSA cache entry created") + + dev[0].request("DISCONNECT") + dev[0].wait_disconnected() + + dev[0].dump_monitor() + dev[0].select_network(id, freq=2412) + ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED", + "CTRL-EVENT-CONNECTED"], timeout=10) + if ev is None: + raise Exception("Connection using PMKSA caching timed out") + if "CTRL-EVENT-EAP-STARTED" in ev: + raise Exception("Unexpected EAP exchange") + hwsim_utils.test_connectivity(dev[0], hapd) + pmksa2 = dev[0].get_pmksa(bssid) + if pmksa2 is None: + raise Exception("No PMKSA cache entry found") + if pmksa['pmkid'] != pmksa2['pmkid']: + raise Exception("Unexpected PMKID change") + + # Verify EAPOL reauthentication after FILS authentication + hapd.request("EAPOL_REAUTH " + dev[0].own_addr()) + ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED"], timeout=5) + if ev is None: + raise Exception("EAP authentication did not start") + ev = dev[0].wait_event(["CTRL-EVENT-EAP-SUCCESS"], timeout=5) + if ev is None: + raise Exception("EAP authentication did not succeed") + time.sleep(0.1) + hwsim_utils.test_connectivity(dev[0], hapd) + def test_fils_sk_pmksa_caching_and_cache_id(dev, apdev): """FILS SK and PMKSA caching with Cache Identifier""" check_fils_capa(dev[0])