From patchwork Fri Mar 2 20:10:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Siedzik X-Patchwork-Id: 880856 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=none (p=none dis=none) header.from=extremenetworks.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EJjINwST"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ztLBx6HDSz9s33 for ; Sat, 3 Mar 2018 07:15:21 +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=TJAuVs2Wx3zuKdgGy114UNwyTRQJo8FiPERmWDZV0RU=; b=EJjINwSTYYgj1u b0H2n5sKJiOc+Yu4bL8HKEr2n7flLzXqtDRWkchrxyXM+qtam5jij+d/zjzDOoLGw3Gc4rSHmj11L RcoccmfGdmirtxXgSXRXANsDZjHxZqHY5jRe5OKHKTLzzoayZxTpC08ytu2YMCpvVb+MyIxXwQbtK wiC9aQxGnQOLLG1sgQd2P2lWIudCf8WtMi7OGBZhb+iNgFPh0qWRYE5tD6XIMJGGRVL5i6rCsKui5 TtSzYsR5A4gcu350aRzAge4lpQdbea2GL3UwFbc9r+VYuevfDVb7fzSKOVTQbwnSYyNk1kTsFwieq xtE1ZxidPHXmyNqF+Jgg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1err5C-0002ro-QS; Fri, 02 Mar 2018 20:15:10 +0000 Received: from us-smtp-delivery-183.mimecast.com ([63.128.21.183]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1err3L-0001J9-Rp for hostap@lists.infradead.org; Fri, 02 Mar 2018 20:13:24 +0000 Received: from USNC-CASHT-P1.corp.extremenetworks.com (owamail.extremenetworks.com [134.141.9.1]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-166-MVNVNvQGOyeGRqIA3zKoVQ-2; Fri, 02 Mar 2018 15:11:01 -0500 Received: from USNC-CASHT-P2.corp.extremenetworks.com (10.6.17.62) by USNC-CASHT-P1.corp.extremenetworks.com (10.6.17.63) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 2 Mar 2018 15:10:58 -0500 Received: from smtp2.extremenetworks.com (10.6.25.34) by USNC-CASHT-P2.corp.extremenetworks.com (10.6.17.64) with Microsoft SMTP Server (TLS) id 15.0.1210.3 via Frontend Transport; Fri, 2 Mar 2018 15:10:58 -0500 Received: from cm-exos1.extremenetworks.com (a10-smtp.extremenetworks.com [10.6.24.14]) by smtp2.extremenetworks.com (8.13.8/8.13.8) with ESMTP id w22KAw1T004948; Fri, 2 Mar 2018 12:10:58 -0800 Received: from cm-exos1.extremenetworks.com (localhost [127.0.0.1]) by cm-exos1.extremenetworks.com (Postfix) with ESMTP id B6FBA2C043C; Fri, 2 Mar 2018 15:11:09 -0500 (EST) Received: (from msiedzik@localhost) by cm-exos1.extremenetworks.com (8.14.7/8.14.7/Submit) id w22KB9tj016339; Fri, 2 Mar 2018 15:11:09 -0500 From: To: Subject: [PATCH 07/15] mka: Detect duplicate MAC addresses during key server election Date: Fri, 2 Mar 2018 15:10:55 -0500 Message-ID: <20180302201103.16264-8-msiedzik@extremenetworks.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20180302201103.16264-1-msiedzik@extremenetworks.com> References: <20180302201103.16264-1-msiedzik@extremenetworks.com> MIME-Version: 1.0 X-MC-Unique: MVNVNvQGOyeGRqIA3zKoVQ-2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180302_121316_509964_CC8B3110 X-CRM114-Status: UNSURE ( 8.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [63.128.21.183 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Siedzik Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Mike Siedzik In the unlikely event the local KaY and the elected peer have the same actor priority as well as the same MAC address, log a warning message and do not elect a key server. Resolution is for network administrator to reconfigure MAC address. Signed-off-by: Michael Siedzik --- src/pae/ieee802_1x_kay.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.11.1 diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c index 70fda1f2d..0c3101cd8 100644 --- a/src/pae/ieee802_1x_kay.c +++ b/src/pae/ieee802_1x_kay.c @@ -2091,6 +2091,7 @@ ieee802_1x_kay_elect_key_server(struct ieee802_1x_mka_participant *participant) struct ieee802_1x_kay_peer *key_server = NULL; struct ieee802_1x_kay *kay = participant->kay; Boolean i_is_key_server; + int priority_comparison; if (participant->is_obliged_key_server) { participant->new_sak = TRUE; @@ -2121,8 +2122,14 @@ ieee802_1x_kay_elect_key_server(struct ieee802_1x_mka_participant *participant) tmp.key_server_priority = kay->actor_priority; os_memcpy(&tmp.sci, &kay->actor_sci, sizeof(tmp.sci)); - if (compare_priorities(&tmp, key_server) < 0) + priority_comparison = compare_priorities(&tmp, key_server); + if (priority_comparison < 0) { i_is_key_server = TRUE; + } else if (priority_comparison == 0) { + wpa_printf(MSG_WARNING, + "KaY: Cannot elect key server between me and peer, duplicate MAC detected"); + key_server = NULL; + } } else if (participant->can_be_key_server) { i_is_key_server = TRUE; }