From patchwork Sun Sep 15 20:08:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Wetzel X-Patchwork-Id: 1162542 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="KjsvU0+n"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=wetzel-home.de header.i=@wetzel-home.de header.b="Gre1Mzrc"; 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 46WgVv2v3Sz9sNx for ; Mon, 16 Sep 2019 06:11:19 +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=EEIAJBbZ3B6nih6b7Lm7C/6UQiA14BOBApk1Fv22+r4=; b=KjsvU0+nMuk2gf iy6q7mDcM2MUfA69sRBDbFfSdEdMkzTedD6cv1X0udwK6HaB/wmrEaqBf+ZtB/kVXfRUSWxaOYXev dUrWg2Lxh2rrtynFdwsAG9QJNDXPt6bejMMiVnm5+RAlc16ScfumRLCuHgDDwfp7m5VqI1r+Eyvud U1Pns/YeZQfQZ9Z6GnjJRxuN9R3j7QatxNGmCnr8d4fbPVlWxnK+plVDEfUA3HsUF7QGbPUMuByG7 HTjHbDnDujnexmYgFeDbNLzhFJ+W2cmWqkNlAwW+sLak7LyrqEqmSEA5/Tc902Zdj2VTOUS2SPW6U wTBdgFjHFXXhmhhA2I7g==; 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 1i9arc-0000aR-Q6; Sun, 15 Sep 2019 20:11:16 +0000 Received: from 3.mo2.mail-out.ovh.net ([46.105.58.226]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i9apv-0006Mi-DE for hostap@lists.infradead.org; Sun, 15 Sep 2019 20:09:35 +0000 Received: from player799.ha.ovh.net (unknown [10.108.57.38]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id 9A7161A898E for ; Sun, 15 Sep 2019 22:09:19 +0200 (CEST) Received: from awhome.eu (p57B7E67F.dip0.t-ipconnect.de [87.183.230.127]) (Authenticated sender: postmaster@awhome.eu) by player799.ha.ovh.net (Postfix) with ESMTPSA id 27E669CD9464; 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=nK89OqwHJs2TD4eoS6Ic6nTvwlYk8fG71UpwDZFz0dI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Gre1Mzrc8FbBBexZOtJRMtJgSlLgd3qxfL2vwc3/AUNw0nHeV2BkSV/MThV9gvNmZ DlWi87eKoXa3TYB6vSbJz6KQXSWj9qKFEEC/Dpq/2JOYoB3nh5kKzB4WVRAx6Dexqq BNiOtHIOyXYHSzCmtbo4gYEIMC8xgqUnSzY8R0dQ= To: j@w1.fi Subject: [PATCH v6 09/17] nl80211,wpa_supplicant: Drop outdated tdls hack Date: Sun, 15 Sep 2019 22:08:29 +0200 Message-Id: <20190915200837.196283-10-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: 11128113207983217916 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_130931_592878_120296B3 X-CRM114-Status: GOOD ( 12.84 ) 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.58.226 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 wpa_tdls_set_key() did set key_id to -1 as a signal to handle the key install a bit different than for other pairwise keys. Since we cleaned up the key install logic with a previous patch this is no longer needed and can be removed. Signed-off-by: Alexander Wetzel --- The workaround cleaned up here is not limited to nl80211, so I put it into a separate patch. It just finalizes the nl80211 driver key install cleanup without breaking anything in between. src/drivers/driver_nl80211.c | 6 ------ src/rsn_supp/tdls.c | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index f168769f8..f15f1e15f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3027,12 +3027,6 @@ static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss, "set_tx=%d seq_len=%lu key_len=%lu key_type=%d", __func__, ifindex, ifname, alg, addr, key_idx, set_tx, (unsigned long) seq_len, (unsigned long) key_len, key_type); -#ifdef CONFIG_TDLS - if (key_idx == -1) { - key_idx = 0; - } -#endif /* CONFIG_TDLS */ - #ifdef CONFIG_DRIVER_NL80211_QCA if (alg == WPA_ALG_PMK && (drv->capa.flags & WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD)) { diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c index 348c491be..01d339290 100644 --- a/src/rsn_supp/tdls.c +++ b/src/rsn_supp/tdls.c @@ -227,7 +227,7 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct wpa_tdls_peer *peer) wpa_printf(MSG_DEBUG, "TDLS: Configure pairwise key for peer " MACSTR, MAC2STR(peer->addr)); - if (wpa_sm_set_key(sm, alg, peer->addr, -1, 1, rsc, sizeof(rsc), + if (wpa_sm_set_key(sm, alg, peer->addr, 0, 1, rsc, sizeof(rsc), peer->tpk.tk, key_len, KEY_TYPE_PAIRWISE) < 0) { wpa_printf(MSG_WARNING, "TDLS: Failed to set TPK to the " "driver");