From patchwork Mon Feb 24 09:15:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peer, Ilan" X-Patchwork-Id: 1242975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=ps+vWR7l; 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 48Qy1G3NlQz9sPk for ; Mon, 24 Feb 2020 20:48:18 +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-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=BiSq2+vWnCF2HDNtafYISA1S4r+9XAseqqsHudIxFCw=; b=ps+vWR7l3hatV/GmnXksJgBIae XMD1CFQ28zBEA82bDJqAlhtXbp0HVFnzi6Aalfwd0B9XZdmbnTs27QSY49waAEn+YJNQ/BqgkDiSJ Vm2Bnz4RgP7f5VbqsaPey06AcLjB19lBhChE6iBVYAa7y6YHytYpt7/EL6MK1alamnSXvpJvLZR80 200MMF67FxJAYWri7I94lRxYNmC3oEx7zXCMzTjeBkT0otPTqsHYOe8w3nrytNFtrNYlockQb6ia/ j9MvmiIUqYiLnepA2G15B8ZgNkrUBBOAT5DiMdnAbGw2fUx3EwfMyHehW0tsX6BMaS6mMJ3KGpKY2 BdtactIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6ALT-00022I-Sl; Mon, 24 Feb 2020 09:48:11 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j69qu-00085d-Kb for hostap@lists.infradead.org; Mon, 24 Feb 2020 09:16:39 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 01:16:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,479,1574150400"; d="scan'208";a="225914720" Received: from jed01681.jer.intel.com ([10.12.190.127]) by orsmga007.jf.intel.com with ESMTP; 24 Feb 2020 01:16:20 -0800 From: Ilan Peer To: hostap@lists.infradead.org Subject: [PATCH 11/14] tests: Add PASN test with comeback flow Date: Mon, 24 Feb 2020 11:15:59 +0200 Message-Id: <20200224091602.15306-12-ilan.peer@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200224091602.15306-1-ilan.peer@intel.com> References: <20200224091602.15306-1-ilan.peer@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200224_011636_800946_FA9387AB X-CRM114-Status: UNSURE ( 8.76 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [134.134.136.100 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 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: Ilan Peer MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Ilan Peer --- tests/hwsim/test_pasn.py | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/hwsim/test_pasn.py b/tests/hwsim/test_pasn.py index 8e7f7add11..9138a86f99 100644 --- a/tests/hwsim/test_pasn.py +++ b/tests/hwsim/test_pasn.py @@ -21,6 +21,7 @@ from utils import HwsimSkip from hwsim import HWSimRadio from test_erp import check_erp_capa, start_erp_as from test_fils import check_fils_capa +import re def check_pasn_capab(dev): if "PASN" not in dev.get_capability("auth_alg"): @@ -533,3 +534,44 @@ def test_pasn_fils_sha256_connected_diff_channel(dev, apdev, params): def test_pasn_fils_sha384_connected_diff_channel(dev, apdev, params): """PASN FILS authentication using SHA-384 while connected diff channel""" check_pasn_fils_connected_diff_channel(dev, apdev, params, "FILS-SHA384") + +@remote_compatible +def test_pasn_comeback(dev, apdev, params): + """ PASN authentication with comeback flow """ + check_pasn_capab(dev[0]) + + params = pasn_ap_params("PASN", "CCMP", "19") + params['anti_clogging_threshold'] = '0' + hapd = hostapd.add_ap(apdev[0], params) + + dev[0].scan(type="ONLY", freq=2412) + cmd = "PASN_START bssid=%s akmp=PASN cipher=CCMP group=19" % (hapd.own_addr()) + + resp = dev[0].request(cmd) + if "OK" not in resp: + raise Exception("Failed to start PASN authentication") + + ev = dev[0].wait_event(["PASN-AUTH-STATUS"], 3) + if not ev: + raise Exception("PASN: PASN-AUTH-STATUS not seen") + + if hapd.own_addr() + " akmp=PASN, status=30 comeback_after=" not in ev: + raise Exception("PASN: unexpected status") + + comeback = re.split("comeback=", ev)[1] + + cmd = "PASN_START bssid=%s akmp=PASN cipher=CCMP group=19 comeback=%s" % \ + (hapd.own_addr(), comeback) + + resp = dev[0].request(cmd) + if "OK" not in resp: + raise Exception("Failed to start PASN authentication") + + ev = dev[0].wait_event(["PASN-AUTH-STATUS"], 3) + if not ev: + raise Exception("PASN: PASN-AUTH-STATUS not seen") + + if hapd.own_addr() + " akmp=PASN, status=0" not in ev: + raise Exception("PASN: unexpected status with comeback token") + + check_pasn_ptk(dev[0], hapd, "CCMP")