From patchwork Thu Oct 31 09:19:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Wetzel X-Patchwork-Id: 1187280 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="tmt6QU3Q"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=wetzel-home.de header.i=@wetzel-home.de header.b="q6f1EyyM"; 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 473fx93vZyz9s4Y for ; Thu, 31 Oct 2019 20:22:37 +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=NymQ+BpgTQY6Zeiw40LMwa39+jDMMkqo8nx1VtfPtig=; b=tmt6QU3Q3ODt6U V7gQN/zjt5M5z2DncfSLL1L67MGMAPbI2EfE1ITzsvvw/F2nVVOu6ILfawq/eRf8JqW50rIMnX/IP x0P3pCJQTPEQU9z8Vd7U2jmk48Visy0E36jH+YHa79Md9et0E1V6oyhD6SUWro9ihgCV54p6OtEs+ YCzOEa284LI0iBDXP4SEUoecDO4XDX2yYFLQtpAPE96hiOaFsm5OHaZEdrKWNUrMGFlOEgQL9K7IP PIWZmd9JJnqDvBUFb7LEfNaq9G624ctgB7fTDPeGJ/HauSqRehBuPGJc2gLrtyD83k13AQh62jly+ EkO0UPARZods7Sc2lpfA==; 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 1iQ6f3-0002FG-8R; Thu, 31 Oct 2019 09:22:33 +0000 Received: from 5.mo178.mail-out.ovh.net ([46.105.51.53]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQ6cZ-0006rZ-Bz for hostap@lists.infradead.org; Thu, 31 Oct 2019 09:20:01 +0000 Received: from player692.ha.ovh.net (unknown [10.109.146.240]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id DC44E783C8 for ; Thu, 31 Oct 2019 10:19:56 +0100 (CET) Received: from awhome.eu (p4FF914F9.dip0.t-ipconnect.de [79.249.20.249]) (Authenticated sender: postmaster@awhome.eu) by player692.ha.ovh.net (Postfix) with ESMTPSA id 20062B7A9A8E; Thu, 31 Oct 2019 09:19:53 +0000 (UTC) From: Alexander Wetzel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1572513591; bh=uCaq8YUZ/9bvqaDm0uVR+JYyc4mWdi22brtiiqWtIac=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=q6f1EyyM9v0YNT3Awrnexh4IGL9AidO94An4gPOuqeVCuuSHpuCA+fDNOTa9fYxz3 EXy+GEmXwhO1cnSFm4zbkOuBZf/4rGnQvFeWEpLhd+kyFFi3Pktne4y9tkgoO/P7Lw wlJi11N7o/mOsMnnoQXqQneDq+nRNpRsc1u+Y+yQ= To: j@w1.fi Subject: [Patch v8 15/15] AP: Extended Key ID stress test Date: Thu, 31 Oct 2019 10:19:01 +0100 Message-Id: <20191031091901.2889-16-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: 12050506705390476540 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_021959_573553_6EC1E395 X-CRM114-Status: GOOD ( 20.22 ) 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 [46.105.51.53 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 Change the default keyid to 1 for the first pairwise key when using Extended Key ID. This is so far only intended to cause compatibility problems as soon as possible and not delay them till we rekey. When a broken STA claims to be compatible with Extended Key ID it will still assume keyid 0 is being used for the first key and never be able to communicate with our AP supporting Extended Key ID. Signed-off-by: Alexander Wetzel --- For now this is serves two functions: 1) Guarantees that Extended Key ID can really be used at the initial connect. Many potential issues are linked to the usage of keyid 1 for a unicast key, so make sure this happens as soon as possible. 2) The existing tests will find many of these issues, even when not rekeying the connection I have some ideas to potential extend on that later: By e.g. starting a EAPOL group handshake directly after the connect we can verify if the keyid 1 transport is really working. When the handshake times out hostapd could install the same key for keyid 0, disabling Extended Key ID support and allow the broken STA to still communicate with the BSS. This idea is mostly based to the fact that one of my devices (Samsung Galaxy Tap S3) is setting the "Extended Key ID" capability flag wrong. The AP therefore (correctly) starts using it. But when the AP rekeys the PTK is losing the connection. It looks like the device is just copying the capability bit from the AP RSN. And chances are more devices have the same bug... I'm not sure if we really want to deploy such a workaround. It's probably hard to get rid of and just getting the broken devices fixed is be the better solution. But till that is done users will wonder why it's not working, so handling that outside of the standard may be better. Of course the workaround would be optional: I think we could set wpa_extended_key_id to 2 by default and allow the user to disable the workaround by setting it to 1. Another option would be to simply drop the patch or use it only when creating binaries for testing. (CONFIG_TESTING_OPTIONS) After all PTK rekeying is - based on all devices I could get my hands on - mostly broken. The chance to have an AP and a STA able to rekey really correctly under load is as of today really bad. (Maybe 20% success rate?) Therefore it looks like rekey is not used very often and when we start with keyid 0 and never rekey it will also work for most users. On the other hand I prefer a clean failure to something working on the brink of failure: So this patch series tries to make sure it fails as soon as possible. src/ap/wpa_auth_ie.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ap/wpa_auth_ie.c b/src/ap/wpa_auth_ie.c index 599df469b..14eae3bc0 100644 --- a/src/ap/wpa_auth_ie.c +++ b/src/ap/wpa_auth_ie.c @@ -575,6 +575,7 @@ int handle_extended_key_id(struct wpa_state_machine *sm, int capabilities) " supports Extended Key ID", MAC2STR(sm->addr)); sm->use_extended_key_id = TRUE; + sm->keyidx_active = 1; } else if (!sm->pairwise_set) { wpa_printf(MSG_DEBUG, "STA " MACSTR " is not supporting Extended Key ID",