From patchwork Sun Dec 11 17:54:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 130614 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8E77DB6F71 for ; Mon, 12 Dec 2011 04:54:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5B12A9C166; Sun, 11 Dec 2011 12:54:54 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mPEZsd9CIpTE; Sun, 11 Dec 2011 12:54:54 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 164F89C12D; Sun, 11 Dec 2011 12:54:50 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DB02B9C12D for ; Sun, 11 Dec 2011 12:54:48 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y1Yu+n1SFv2E for ; Sun, 11 Dec 2011 12:54:45 -0500 (EST) Received: from sipsolutions.net (he.sipsolutions.net [78.46.109.217]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 366E89C12C for ; Sun, 11 Dec 2011 12:54:45 -0500 (EST) Received: by sipsolutions.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.77) (envelope-from ) id 1RZnbn-0002pl-GY; Sun, 11 Dec 2011 18:54:43 +0100 Subject: [PATCH] IBSS: fix RSN key initialisation From: Johannes Berg To: hostap Date: Sun, 11 Dec 2011 18:54:43 +0100 Message-ID: <1323626083.19298.1.camel@jlt3.sipsolutions.net> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Cc: Antonio Quartulli X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Johannes Berg Antonio reported that RSN IBSS failed to work. We traced it down to a GTK failure, and he then bisected it to commit bdffdc5ddb0c838af4c90d11: "AP: Reorder WPA/Beacon initialization". The reason this commit broke it is that the state machine's GInit variable is never set to false as wpa_init_keys() never gets called, and thus new keys are generated every time the state machine executes. Fix this by calling wpa_init_keys() when the new group has been initialised. Reported-by: Antonio Quartulli Tested-by: Antonio Quartulli Signed-hostap: Johannes Berg --- wpa_supplicant/ibss_rsn.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c index 4bab906..d4fa39d 100644 --- a/wpa_supplicant/ibss_rsn.c +++ b/wpa_supplicant/ibss_rsn.c @@ -339,6 +339,8 @@ static int ibss_rsn_auth_init_group(struct ibss_rsn *ibss_rsn, return -1; } + wpa_init_keys(ibss_rsn->auth_group); + return 0; }