From patchwork Wed Oct 26 21:41:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jouni Malinen X-Patchwork-Id: 9398473 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0ED1560234 for ; Wed, 26 Oct 2016 21:43:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCA1929ABD for ; Wed, 26 Oct 2016 21:43:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C18B429C05; Wed, 26 Oct 2016 21:43:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D6CD29B3A for ; Wed, 26 Oct 2016 21:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934200AbcJZVnD (ORCPT ); Wed, 26 Oct 2016 17:43:03 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:42186 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933183AbcJZVnA (ORCPT ); Wed, 26 Oct 2016 17:43:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1477518180; x=1509054180; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=DXFrXxhgJ1NF9HyVUSRJgNFglMfNgAzQZRDX0/Qz2wE=; b=tCAXLskC3UCb58TJpeIfdAuUd2fvEfEicF+T41wYvup1V1pv3dnRW7S/ FM9G3TlnKQ5fJWPCt/TZLP9chE7O18T7ydB3s8uYv5uYnqLSdHJrfQN6B TAXI/GYX3VlenTsomr0c2qdL7UKtXHovmU36cnZ/d8qbabuPWH91DPxF7 A=; X-IronPort-AV: E=Sophos;i="5.31,551,1473145200"; d="scan'208";a="330230509" Received: from unknown (HELO Ironmsg03-R.qualcomm.com) ([10.53.140.107]) by wolverine02.qualcomm.com with ESMTP; 26 Oct 2016 14:42:59 -0700 X-IronPort-AV: E=McAfee;i="5700,7163,8330"; a="1245399027" Received: from nasanexm02e.na.qualcomm.com ([10.85.0.86]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 26 Oct 2016 14:42:59 -0700 Received: from eusanexr01e.eu.qualcomm.com (10.85.0.100) by nasanexm02e.na.qualcomm.com (10.85.0.86) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 26 Oct 2016 14:42:59 -0700 Received: from jouni.qca.qualcomm.com (10.80.80.8) by eusanexr01e.eu.qualcomm.com (10.85.0.100) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 26 Oct 2016 14:42:56 -0700 From: Jouni Malinen To: Johannes Berg CC: , Jouni Malinen Subject: [PATCH v2 2/9] mac80211: Allow AUTH_DATA to be used for FILS Date: Thu, 27 Oct 2016 00:41:59 +0300 Message-ID: <1477518126-823-3-git-send-email-jouni@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477518126-823-1-git-send-email-jouni@qca.qualcomm.com> References: <1477518126-823-1-git-send-email-jouni@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To eusanexr01e.eu.qualcomm.com (10.85.0.100) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The special SAE case should be limited only for SAE since the more generic AUTH_DATA can now be used with other authentication algorithms as well. Signed-off-by: Jouni Malinen --- net/mac80211/mlme.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 32fd295..b6222f2 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4491,9 +4491,11 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, auth_data->bss = req->bss; if (req->auth_data_len >= 4) { - __le16 *pos = (__le16 *) req->auth_data; - auth_data->sae_trans = le16_to_cpu(pos[0]); - auth_data->sae_status = le16_to_cpu(pos[1]); + if (req->auth_type == NL80211_AUTHTYPE_SAE) { + __le16 *pos = (__le16 *) req->auth_data; + auth_data->sae_trans = le16_to_cpu(pos[0]); + auth_data->sae_status = le16_to_cpu(pos[1]); + } memcpy(auth_data->data, req->auth_data + 4, req->auth_data_len - 4); auth_data->data_len += req->auth_data_len - 4;