From patchwork Tue Sep 1 08:53:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ouden Lin X-Patchwork-Id: 1359856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=TaPcOUSz; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=JWkjsKfp; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmBQp5zG7z9sRK for ; Wed, 9 Sep 2020 03:07:14 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:To:Subject:Message-ID:Date:From:MIME-Version:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ipXyDhAdYwYRlNUod6pe72eOvimfRaI5emrJxjsHTbs=; b=TaPcOUSz8/JKR0Ihu7naDPm13o 5J0ZdTFnZU6+OKgSq3kaQ5VeIx6DAWEjglPzXWI8D7RrqbMhUFHqUFnb/0idjU3+6xJRp8mdhgRGS ynylBCEn1E7OsS56qLXCBy9p2uR6qMzrJHCgnO09rbbptla2ezJ6StSdSKMKP0FB4eti0ed4DfccX ZxtZRkR3qJqYTa1Ipqz/OlE79pkmKO2MbhQDnSMwg9H4kUMfYcSYFr92lZSfHkf+zFnPxW+PdlgLt dZirbhY0lLRmDqsk4XnvvYwKCpWyA4iE/PUxmKlo2Rg185t51U6z8NNrDi64PawlI/H8GHRsOTm8w g8xeHJgg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFh4o-0002Qt-0H; Tue, 08 Sep 2020 17:06:38 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD22Y-0007jS-4h for hostap@lists.infradead.org; Tue, 01 Sep 2020 08:53:19 +0000 Received: by mail-lf1-x12f.google.com with SMTP id y11so320211lfl.5 for ; Tue, 01 Sep 2020 01:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=eWOxxQjYsTAiiREhQhP1mABmhfxcZFp7uXWZUZonAXo=; b=JWkjsKfpOtTSVjtjrJr8AdskKqbFjIzYuvxzlokfHXbtjrb+6WkVOhdiwATe4kZRze wfgQqXM7jcOrK5+nyhGRccvFvNbufc9IxitL5fKbrvRVuTDSaMm51jPYHnkXa0T9uu9Z 8HMveSd+zvbHQlqNU07RYkbsBJ4qAEB5ySka5uZZYq6n0PdhcxjMSeRS+RGJdW0VFUkQ QoKp6WfPTL67B3cdAGmC/OvtPJq+I5ZXvL9ZYIpdGYLbq2wsXhfClPH/+lqU7WremaaO cw327O6yAq2kbmesg0jLhibCzG54EmcX9aTuMuGqVh7uaW8E0Nre2h/buImDWU8wYx0/ /H5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=eWOxxQjYsTAiiREhQhP1mABmhfxcZFp7uXWZUZonAXo=; b=sycR0cBGync9KA4gyvzcedK0orwXs5H2SSfDn5Lt0mauymoaA2P395Fu4pskSNjsC9 SZIPIV5WM4+X5I89t09CGaVVrDIpPFTO10ZF26Zz4HdhuzUkEx7itr1voG0QmLJdQ7h/ viqaD494MdFTb2/rGyk0ahHnoDnXc+eszZE2yfLAx1MOb2SR3kK+oxnzxKGc4c6a//TE X7vPD+kWaSIAJyx7glWP/hkRvqLQ5zCSEukB1OXdzU0OjULkKyMsChBJM/dahI0k5szV tqwJgyyUL0IpTtJnHrzf9dgJP1H6LqlxA9yR4G5RGE2R1+zkG7LlcyyhsOnHI7oux+Rn BMnQ== X-Gm-Message-State: AOAM532fti1sGCSp6wQbkkbO47DcRLleqPT/SJ4N57hN6ZCW4JoSl1hL S4+yCcsaC9XlDR9TsvNqiwXniDp1PBWEwy7McuftzYoxF6U= X-Google-Smtp-Source: ABdhPJytp4whKsv6bWIqFzOWFRwH4ew41fhRK3D8ljL2hAdiS0Ddl8eR7TQ1CBQee+fU94NCjQJXp2veS8EmqJnmABI= X-Received: by 2002:a05:6512:687:: with SMTP id t7mr52766lfe.13.1598950394071; Tue, 01 Sep 2020 01:53:14 -0700 (PDT) MIME-Version: 1.0 From: "Ouden.Biz Lin" Date: Tue, 1 Sep 2020 16:53:02 +0800 Message-ID: Subject: SAE: Notify WRONG Key when Confirm mismatch To: hostap@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200901_045318_192042_60F4F4C9 X-CRM114-Status: GOOD ( 12.55 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:12f listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ouden.biz[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Mailman-Approved-At: Tue, 08 Sep 2020 13:06:36 -0400 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi there, I have a question about the WRONG Key. In WPA2-PSK case, that has the WRONG Key message to notify user. But, In WPA3-SAE, no message to notify user. I check the flow, When I use the wrong key to connect AP. AP will get the Confirm mismatch and send the Confirm with status (1) to STA. So, I added some checks to send the "WRONG Key" as below. Can somebody help to review and comment on it ? Thank you very much. Ouden wpa_s, WLAN_STATUS_UNSPECIFIED_FAILURE); @@ -1279,6 +1283,10 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data) data->auth.status_code, data->auth.ies, data->auth.ies_len, 0, NULL); if (res < 0) { + if ((data->auth.auth_transaction) == 2) + && (data->auth.status_code) == 1)) { + wpas_auth_failed(wpa_s, "WRONG_KEY"); + } wpas_connection_failed(wpa_s, wpa_s->pending_bssid); wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED); diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index dd5020179..b29d936fd 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -1222,6 +1222,10 @@ void sme_external_auth_mgmt_rx(struct wpa_supplicant *wpa_s, header->u.auth.variable, len - auth_length, 1, header->sa); if (res < 0) { + if ((le_to_host16(header->u.auth.auth_transaction) == 2) + && (le_to_host16(header->u.auth.status_code) == 1)) { + wpas_auth_failed(wpa_s, "WRONG_KEY"); + } /* Notify failure to the driver */ sme_send_external_auth_status(