From patchwork Thu Oct 31 09:18:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Wetzel X-Patchwork-Id: 1187273 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=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="jKjGaIMT"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=wetzel-home.de header.i=@wetzel-home.de header.b="aPTrhZoZ"; 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 473fvP164Dz9s4Y for ; Thu, 31 Oct 2019 20:21:05 +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: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=CX6plLBTdZCd1CX7DKFa2+KWmh+EgavI0/e+Khe75kI=; b=jKjGaIMTz0x0qB Ab5B0fiBmgf9W3TFzJpoQ27VimHdOPOzhSSbzFCfX8Pf5Bqp17iQc6OBd125bepZimMxF8pabwbxg q4qB/9gYOyzZ+KlPxG7h1iC+hbqM6ZvwmLaBOHJMIMIw2FpwS57cHiI13SCwb/W4Wzhhpg+LnGE6a /iYpDKImfOVp4b7uZ9iS+VjQEoO0WX8+iKzp7lTJdicm9UFpOtUuf3tHZWBa7NI9htwQ6h5PXKGu1 IgHA/7IpJEj8JSgr7QC76+kCToUFzlzkDRn5nuZRZjv+VRHlI7MfxJfcuXvCJV0U4FcvsJhowsPse hf0KWVm9NNowBf8AyCNA==; 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 1iQ6dY-0000oT-F7; Thu, 31 Oct 2019 09:21:00 +0000 Received: from 8.mo4.mail-out.ovh.net ([188.165.33.112]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQ6cK-0006bo-Or for hostap@lists.infradead.org; Thu, 31 Oct 2019 09:19:46 +0000 Received: from player735.ha.ovh.net (unknown [10.108.35.223]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id 83CF520DCF5 for ; Thu, 31 Oct 2019 10:19:41 +0100 (CET) Received: from awhome.eu (p4FF914F9.dip0.t-ipconnect.de [79.249.20.249]) (Authenticated sender: postmaster@awhome.eu) by player735.ha.ovh.net (Postfix) with ESMTPSA id EB290B9B2DAB; Thu, 31 Oct 2019 09:19:37 +0000 (UTC) From: Alexander Wetzel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1572513577; bh=TTjSSPhBo3J2d0nvFauoz70yvShpO44/eCvQ8fnVMJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aPTrhZoZEEj/aRVdQldaGAyKRHod8zU/sRC94kkq6bKBnfmiGa6Dy3GcDsDN/+udJ Ch+vw+pHjqzCglMjBwarpvG13w8u4sqR4XPfXasAoTMZiXloa2xzuzt7ejaMAgtl4e lwCHLMAZ/VciAEIpjM93AB8VMI5o9jTBzB8t5+0w= To: j@w1.fi Subject: [Patch v8 08/15] common: Extended Key ID support Date: Thu, 31 Oct 2019 10:18:54 +0100 Message-Id: <20191031091901.2889-9-alexander@wetzel-home.de> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191031091901.2889-1-alexander@wetzel-home.de> References: <20191031091901.2889-1-alexander@wetzel-home.de> MIME-Version: 1.0 X-Ovh-Tracer-Id: 12046284579314343164 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedruddthecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191031_021944_994828_1718A68F X-CRM114-Status: GOOD ( 12.86 ) 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 [188.165.33.112 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 Prepare common code for the Extended Key ID patches. - Add the new driver flag WPA_DRIVER_FLAGS_EXTENDED_KEY_ID - RSN parsing for the new attribute KeyID - Extend FT IE parser to also store the capabilities Signed-off-by: Alexander Wetzel --- All of the changes only make sense with the following Extended Key ID patches. src/common/wpa_common.c | 9 +++++++++ src/common/wpa_common.h | 2 ++ src/drivers/driver.h | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c index ea9f7a21c..8c1e6e234 100644 --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c @@ -963,6 +963,7 @@ int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, parse->rsn_pmkid = data.pmkid; parse->key_mgmt = data.key_mgmt; parse->pairwise_cipher = data.pairwise_cipher; + parse->capabilities = data.capabilities; if (update_use_sha384) { use_sha384 = wpa_key_mgmt_sha384(parse->key_mgmt); @@ -2681,6 +2682,14 @@ static int wpa_parse_generic(const u8 *pos, const u8 *end, return 0; } + if (pos[1] > RSN_SELECTOR_LEN + 1 && + RSN_SELECTOR_GET(pos + 2) == RSN_KEY_DATA_KEYID) { + ie->key_id = pos + 2 + RSN_SELECTOR_LEN; + wpa_hexdump(MSG_DEBUG, "WPA: KeyID in EAPOL-Key", + pos, pos[1] + 2); + return 0; + } + if (pos[1] > RSN_SELECTOR_LEN + 2 && RSN_SELECTOR_GET(pos + 2) == RSN_KEY_DATA_GROUPKEY) { ie->gtk = pos + 2 + RSN_SELECTOR_LEN; diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h index beb1ecd5e..4ef5cd13c 100644 --- a/src/common/wpa_common.h +++ b/src/common/wpa_common.h @@ -465,6 +465,7 @@ struct wpa_ft_ies { int pairwise_cipher; const u8 *rsnxe; size_t rsnxe_len; + int capabilities; }; int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse, @@ -476,6 +477,7 @@ struct wpa_eapol_ie_parse { const u8 *rsn_ie; size_t rsn_ie_len; const u8 *pmkid; + const u8 *key_id; const u8 *gtk; size_t gtk_len; const u8 *mac_addr; diff --git a/src/drivers/driver.h b/src/drivers/driver.h index bf41e9133..bf75d695f 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1704,6 +1704,8 @@ struct wpa_driver_capa { #define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL /** Driver support 4-way handshake offload for WPA-Personal */ #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL +/** Driver supports Extended Key ID */ +#define WPA_DRIVER_FLAGS_EXTENDED_KEY_ID 0x0400000000000000ULL u64 flags; #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \