summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorSunil Ravi <sunilravi@google.com>2020-04-23 18:10:51 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-23 18:10:51 +0000
commit2401b2425b576944d44412374054d7c55c6cd71d (patch)
tree81259a6f6f371aaf427ba530c2bf8bb262244bf0 /service
parentdfdfd6a374fdded345a06c82f74d10cf09c5bf68 (diff)
parent362e8087cfdc3924e034398c96d283b3a085f6dd (diff)
Merge "wifi: Indicate AUTH_FAILURE for WEP password error" into rvc-dev am: 20726863b9 am: 362e8087cf
Change-Id: I367c304f44aae75808137b96c8cbe5c280e4bdb8
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/SupplicantStaIfaceCallbackImpl.java41
1 files changed, 24 insertions, 17 deletions
diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceCallbackImpl.java b/service/java/com/android/server/wifi/SupplicantStaIfaceCallbackImpl.java
index 2d78514e4..92ba43b4c 100644
--- a/service/java/com/android/server/wifi/SupplicantStaIfaceCallbackImpl.java
+++ b/service/java/com/android/server/wifi/SupplicantStaIfaceCallbackImpl.java
@@ -258,29 +258,36 @@ abstract class SupplicantStaIfaceCallbackImpl extends ISupplicantStaIfaceCallbac
public void onAssociationRejected(byte[/* 6 */] bssid, int statusCode, boolean timedOut) {
synchronized (mLock) {
mStaIfaceHal.logCallback("onAssociationRejected");
+ boolean isWrongPwd = false;
WifiConfiguration curConfiguration =
mStaIfaceHal.getCurrentNetworkLocalConfig(mIfaceName);
- if (curConfiguration != null && !timedOut) {
- Log.d(TAG, "flush PMK cache due to association rejection for config id "
- + curConfiguration.networkId + ".");
- mStaIfaceHal.removePmkCacheEntry(curConfiguration.networkId);
- }
-
- if (statusCode == StatusCode.UNSPECIFIED_FAILURE) {
- if (curConfiguration != null
- && curConfiguration.allowedKeyManagement
- .get(WifiConfiguration.KeyMgmt.SAE)) {
- // Special handling for WPA3-Personal networks. If the password is
- // incorrect, the AP will send association rejection, with status code 1
- // (unspecified failure). In SAE networks, the password authentication
- // is not related to the 4-way handshake. In this case, we will send an
- // authentication failure event up.
+ if (curConfiguration != null) {
+ if (!timedOut) {
+ Log.d(TAG, "flush PMK cache due to association rejection for config id "
+ + curConfiguration.networkId + ".");
+ mStaIfaceHal.removePmkCacheEntry(curConfiguration.networkId);
+ }
+ // Special handling for WPA3-Personal networks. If the password is
+ // incorrect, the AP will send association rejection, with status code 1
+ // (unspecified failure). In SAE networks, the password authentication
+ // is not related to the 4-way handshake. In this case, we will send an
+ // authentication failure event up.
+ if (statusCode == StatusCode.UNSPECIFIED_FAILURE
+ && WifiConfigurationUtil.isConfigForSaeNetwork(curConfiguration)) {
mStaIfaceHal.logCallback("SAE incorrect password");
- mWifiMonitor.broadcastAuthenticationFailureEvent(
- mIfaceName, WifiManager.ERROR_AUTH_FAILURE_WRONG_PSWD, -1);
+ isWrongPwd = true;
+ } else if (statusCode == StatusCode.CHALLENGE_FAIL
+ && WifiConfigurationUtil.isConfigForWepNetwork(curConfiguration)) {
+ mStaIfaceHal.logCallback("WEP incorrect password");
+ isWrongPwd = true;
}
}
+
+ if (isWrongPwd) {
+ mWifiMonitor.broadcastAuthenticationFailureEvent(
+ mIfaceName, WifiManager.ERROR_AUTH_FAILURE_WRONG_PSWD, -1);
+ }
mWifiMonitor
.broadcastAssociationRejectionEvent(
mIfaceName, statusCode, timedOut,