From patchwork Sun Aug 25 16:35:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Wetzel X-Patchwork-Id: 1152827 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="enjbk0wR"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=wetzel-home.de header.i=@wetzel-home.de header.b="wfSCnfBG"; 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 46GgnW4pGJz9s7T for ; Mon, 26 Aug 2019 02:38:55 +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=gBdfsFHIMTTLC1967cu8VX+C9xB9k5ZMRMrwpg2HX18=; b=enjbk0wRrr72Ir nREB2D1AlSeu6WSuW/qDLeNaI2RqU8Qlwt3a508FH+EgIDlmt3x9GZSsjKwP+Ji+pOwIZ7OD7xEIz zxT5Ie7f9VgSmIh0gA1Bx30TuL8Exyi3eoxg+FMhpcl844KpHeCJBRqzRd3jwPXXdmB/D7xhdis37 QdqT4/6E+GZuqzgAW5R60XPmWuPQa1JBq97pyeV2DsPm7AJDJHejEDInnwq7Y/aKXt45GZ+qBaUyO pFR0lME0sjuJOtpMkA1DcWwyfstpnYC00VJQE96tqdVtjiABF//MwunuGkod21msR4IB+LnJr/y/3 SJkMxUEa9nK7l3b9zNLQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i1vXZ-00068B-34; Sun, 25 Aug 2019 16:38:53 +0000 Received: from 9.mo6.mail-out.ovh.net ([87.98.171.146]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i1vUm-0003fx-GU for hostap@lists.infradead.org; Sun, 25 Aug 2019 16:36:06 +0000 Received: from player699.ha.ovh.net (unknown [10.108.54.141]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id AE03D1DBD36 for ; Sun, 25 Aug 2019 18:35:49 +0200 (CEST) Received: from awhome.eu (p57B7E04C.dip0.t-ipconnect.de [87.183.224.76]) (Authenticated sender: postmaster@awhome.eu) by player699.ha.ovh.net (Postfix) with ESMTPSA id 3553B916E11E; Sun, 25 Aug 2019 16:35:46 +0000 (UTC) From: Alexander Wetzel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1566750941; bh=GVBb47/gQOtMQemcgGnt+IJIJ4Sya8P4y7yZykirtOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wfSCnfBG5f+oWDlM4pS1mQ2oJKz50SOvdojJw6gN72knZdlc3e/CFE9aMMOemYlrk JJNnQXR1SB2EeepNRqW3eQb5t6rP6S4+bEQgi/WLxomMYz4HvnNtRDi3hXfX9/8OFl WCZC+v7bMMPZtM0VCZa0CM9b42r/dJ8HuB/s3D4M= To: j@w1.fi Subject: [PATCH v5 13/16] wpa_supplicant: FILS Extended Key ID support Date: Sun, 25 Aug 2019 18:35:18 +0200 Message-Id: <20190825163521.22625-14-alexander@wetzel-home.de> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190825163521.22625-1-alexander@wetzel-home.de> References: <20190825163521.22625-1-alexander@wetzel-home.de> MIME-Version: 1.0 X-Ovh-Tracer-Id: 13323055076282998012 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudehvddguddthecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190825_093600_691712_D27FAA10 X-CRM114-Status: GOOD ( 10.53 ) 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.171.146 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_AU Message has a valid DKIM or DK signature from author's domain -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 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 id must be also 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 de463cba6..22ed47799 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -4563,11 +4563,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 ")",