From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from he.sipsolutions.net ([78.46.109.217]:34278 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753194Ab1DESxI (ORCPT ); Tue, 5 Apr 2011 14:53:08 -0400 Subject: RE: [PATCH 1/2] mwifiex: return success in set_default_key for WPA/WPA2 From: Johannes Berg To: Bing Zhao Cc: "linux-wireless@vger.kernel.org" , "John W. Linville" , Amitkumar Karwar , Kiran Divekar , Yogesh Powar , Marc Yang , Frank Huang , Jouni Malinen In-Reply-To: <477F20668A386D41ADCC57781B1F704307FA911ED9@SC-VEXCH1.marvell.com> References: <1301708207-16265-1-git-send-email-bzhao@marvell.com> <1301817775.3984.3.camel@jlt3.sipsolutions.net> <1301819826.3984.9.camel@jlt3.sipsolutions.net> <477F20668A386D41ADCC57781B1F704307FA911ED9@SC-VEXCH1.marvell.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 05 Apr 2011 20:53:04 +0200 Message-ID: <1302029584.4968.6.camel@jlt3.sipsolutions.net> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: Hi, > > Ok Jouni and I just discussed this briefly, and it looks like there is > > indeed a special case where the GTK is also set as the default TX key: > > this case is when the station requested "no pairwise" or when the AP did > > the same thing in the configuration. > > From the wpa_supplicant debug log generated by Amit, it seems that > set_default_key() is called while installing PTK to the driver. Is it > expected? > > WPA: Installing PTK to the driver. > WPA: RSC - hexdump(len=6): 00 00 00 00 00 00 > wpa_driver_nl80211_set_key: ifindex=12 alg=2 addr=0x80a7168 key_idx=0 set_tx=1 seq_len=6 key_len=32 > addr=00:1b:2f:55:79:7e > > The complete log file is attached for your reference. Hmm. I'll need to look at that in more detail. But yeah, set_tx=1 indicates that it'll call set_default_key. > > Is it possible that this just happens to be the case in your tests? It > > looks like that would be rather strange, but that's a corner case where > > the supplicant would possibly set the GTK as the default key. > > Not the same corner case. In our test both pairwise and groupwise are configured. > > > > > In any case, this patch seems wrong in that you should never return > > success if the operation actually failed. > > Could you please advise how we should resolve this? What happens if you just reject the set_default_key and return -EINVAL instead of 0? johannes