From patchwork Wed Nov 2 15:38:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sabrina Dubroca X-Patchwork-Id: 690455 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t8C2y4MMSz9vDr for ; Thu, 3 Nov 2016 02:39:54 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1xde-0007le-H2; Wed, 02 Nov 2016 15:39:42 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1xdb-0007gy-5B for hostap@lists.infradead.org; Wed, 02 Nov 2016 15:39:40 +0000 Received: from mfilter22-d.gandi.net (mfilter22-d.gandi.net [217.70.178.150]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 69E85A80F1; Wed, 2 Nov 2016 16:39:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter22-d.gandi.net X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter22-d.gandi.net (mfilter22-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id YuPpVNb_qInB; Wed, 2 Nov 2016 16:39:14 +0100 (CET) X-Originating-IP: 217.192.177.51 Received: from localhost (unknown [217.192.177.51]) (Authenticated sender: sd@queasysnail.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 8A58DA810A; Wed, 2 Nov 2016 16:39:14 +0100 (CET) From: Sabrina Dubroca To: hostap@lists.infradead.org Subject: [PATCH 2/5] mka: disable peer detection timeout for PSK mode Date: Wed, 2 Nov 2016 16:38:36 +0100 Message-Id: X-Mailer: git-send-email 2.10.1 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161102_083939_422601_9CF06AE6 X-CRM114-Status: UNSURE ( 8.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2001:4b98:c:538:0:0:0:195 listed in] [list.dnswl.org] -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.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sabrina Dubroca MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The first peer may take a long time to come up. In PSK mode we are basically in a p2p system, and we cannot know when a peer will join the key exchange. Wait indefinitely, and let the administrator decide if they want to abort. Signed-off-by: Sabrina Dubroca --- src/pae/ieee802_1x_kay.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c index 63bbd135213a..c76968dc7b78 100644 --- a/src/pae/ieee802_1x_kay.c +++ b/src/pae/ieee802_1x_kay.c @@ -3337,8 +3337,17 @@ ieee802_1x_kay_create_mka(struct ieee802_1x_kay *kay, struct mka_key_name *ckn, usecs = os_random() % (MKA_HELLO_TIME * 1000); eloop_register_timeout(0, usecs, ieee802_1x_participant_timer, participant, NULL); - participant->mka_life = MKA_LIFE_TIME / 1000 + time(NULL) + - usecs / 1000000; + + /* Disable MKA lifetime for PSK mode. + * The peer(s) can take a long time to come up, because we + * create a "standby" MKA, and we need it to remain live until + * some peer appears. + */ + if (mode != PSK) { + participant->mka_life = MKA_LIFE_TIME / 1000 + + time(NULL) + + usecs / 1000000; + } return participant;