From patchwork Sun Sep 15 20:08:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Wetzel X-Patchwork-Id: 1162536 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="m12bjRMm"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=wetzel-home.de header.i=@wetzel-home.de header.b="nuoAKSt8"; 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 46WgTR5knyz9sNx for ; Mon, 16 Sep 2019 06:10:03 +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=MPzquqfa8v1ANXimXpoqc41F83mpavGmmEcMciCEddA=; b=m12bjRMmZQ0SSQ aJ60gVuNOmwvD5ptQCul/E8oaSOoZCjv3lgfIOqV6GS7HN6ohgxwouL+mjvJpWnoo4ndTt4LQD7TO ryd9te/xUUeO0UsMbkmDtgeV/JZEbVwqxd2CNyXXoDRRiCzeYMFEE6lrTf3+LxuT0dfjzu3Z5T/bU vWhrGShyfzv0q195EmkPlM3xy1yknPU5qWWU189peH6weW+p/boB3YxRai/IB8iaRDVtiSko9AE28 9CYSFIjTz8hQk8cKYZe0SVfY8PLsgfbxY//cOP4WRoaxWJkHsHcRk2dXcN2Cok7n+ih7SgGLEqRcT 9a4RMWCs4+FKvIbSvUoA==; 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 1i9aqO-0006jn-U9; Sun, 15 Sep 2019 20:10:01 +0000 Received: from 13.mo7.mail-out.ovh.net ([87.98.150.175]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9apt-0006Mc-Mg for hostap@lists.infradead.org; Sun, 15 Sep 2019 20:09:33 +0000 Received: from player698.ha.ovh.net (unknown [10.109.160.76]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id 300ED131FB2 for ; Sun, 15 Sep 2019 22:09:20 +0200 (CEST) Received: from awhome.eu (p57B7E67F.dip0.t-ipconnect.de [87.183.230.127]) (Authenticated sender: postmaster@awhome.eu) by player698.ha.ovh.net (Postfix) with ESMTPSA id DBDA49D05DE8; Sun, 15 Sep 2019 20:09:16 +0000 (UTC) From: Alexander Wetzel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1568578151; bh=Ea8g3ZSukUUxvZHhnUfsWn/OWreGsrBw3AkUJwKWIAw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nuoAKSt8ShJXRvC4uwhiSzq6oMpVx7aJmHWFYpE/K7sCOaeTW0agAavDyBydXBd8r rwnaTCaZybptgROsH0ysoLF9J1Gq//2wqekXtTa1LVaLssaksL2UsJt/qLfK//Eezm rj6ZWDfGPITlqPyw5qfUFmEv0YKroFVISADcq7wc= To: j@w1.fi Subject: [PATCH v6 14/17] wpa_supplicant: FILS Extended Key ID support Date: Sun, 15 Sep 2019 22:08:34 +0200 Message-Id: <20190915200837.196283-15-alexander@wetzel-home.de> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190915200837.196283-1-alexander@wetzel-home.de> References: <20190915200837.196283-1-alexander@wetzel-home.de> MIME-Version: 1.0 X-Ovh-Tracer-Id: 11128394683190615292 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedruddugddugeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenuc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190915_130930_064143_CAE630C2 X-CRM114-Status: GOOD ( 10.65 ) 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.150.175 listed in list.dnswl.org] -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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 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 implements the FILS Extended Key ID support in wpa_supplicant compatible to our implementation for hostapd: When supporting Extended Key ID the KeyID for the pairwise key must be included in the FILS handshake. Signed-off-by: Alexander Wetzel --- src/rsn_supp/wpa.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index 802f4f362..3bd8fcd99 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -4536,11 +4536,16 @@ int fils_process_assoc_resp(struct wpa_sm *sm, const u8 *resp, size_t len) keylen, (long unsigned int) sm->ptk.tk_len); goto fail; } + + if (handle_extended_key_id(sm, &kde, + elems.rsn_ie - 2, elems.rsn_ie_len + 2)) + goto fail; + rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher); wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver", sm->ptk.tk, keylen); - if (wpa_sm_set_key(sm, alg, sm->bssid, 0, 1, null_rsc, rsclen, - sm->ptk.tk, keylen, KEY_TYPE_PAIRWISE) < 0) { + if (wpa_sm_set_key(sm, alg, sm->bssid, sm->keyidx_active, 1, null_rsc, + rsclen, sm->ptk.tk, keylen, KEY_TYPE_PAIRWISE) < 0) { wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "FILS: Failed to set PTK to the driver (alg=%d keylen=%d bssid=" MACSTR ")",