summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-08-10 19:01:27 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-08-10 19:01:27 +0000
commit8b4c38fad28348588becfbc7b9a4b3c06b4d21e5 (patch)
tree1aaf39da08e0bcb6afff648fc76592b71e484383
parent322b5bc56c4d59b0129842c8af55a32f0d5c43e0 (diff)
parent653590862adc4555d583576fef81b82d4ece4949 (diff)
Merge "NullPointerException on authentication of SIM based EAP" into rvc-qpr-dev
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java26
1 files changed, 18 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index 27d58501b..2a487e312 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -5813,15 +5813,20 @@ public class ClientModeImpl extends StateMachine {
}
void handleGsmAuthRequest(SimAuthRequestData requestData) {
+ WifiConfiguration requestingWifiConfiguration = null;
if (mTargetWifiConfiguration != null
&& mTargetWifiConfiguration.networkId
== requestData.networkId) {
+ requestingWifiConfiguration = mTargetWifiConfiguration;
logd("id matches targetWifiConfiguration");
} else if (mLastNetworkId != WifiConfiguration.INVALID_NETWORK_ID
&& mLastNetworkId == requestData.networkId) {
+ requestingWifiConfiguration = getCurrentWifiConfiguration();
logd("id matches currentWifiConfiguration");
- } else {
- logd("id does not match targetWifiConfiguration");
+ }
+
+ if (requestingWifiConfiguration == null) {
+ logd("GsmAuthRequest received with null target/current WifiConfiguration.");
return;
}
@@ -5838,15 +5843,15 @@ public class ClientModeImpl extends StateMachine {
* [SRES][Cipher Key Kc]
*/
String response = mWifiCarrierInfoManager
- .getGsmSimAuthResponse(requestData.data, mTargetWifiConfiguration);
+ .getGsmSimAuthResponse(requestData.data, requestingWifiConfiguration);
if (response == null) {
// In case of failure, issue may be due to sim type, retry as No.2 case
response = mWifiCarrierInfoManager
- .getGsmSimpleSimAuthResponse(requestData.data, mTargetWifiConfiguration);
+ .getGsmSimpleSimAuthResponse(requestData.data, requestingWifiConfiguration);
if (response == null) {
// In case of failure, issue may be due to sim type, retry as No.3 case
response = mWifiCarrierInfoManager.getGsmSimpleSimNoLengthAuthResponse(
- requestData.data, mTargetWifiConfiguration);
+ requestData.data, requestingWifiConfiguration);
}
}
if (response == null || response.length() == 0) {
@@ -5859,20 +5864,25 @@ public class ClientModeImpl extends StateMachine {
}
void handle3GAuthRequest(SimAuthRequestData requestData) {
+ WifiConfiguration requestingWifiConfiguration = null;
if (mTargetWifiConfiguration != null
&& mTargetWifiConfiguration.networkId
== requestData.networkId) {
+ requestingWifiConfiguration = mTargetWifiConfiguration;
logd("id matches targetWifiConfiguration");
} else if (mLastNetworkId != WifiConfiguration.INVALID_NETWORK_ID
&& mLastNetworkId == requestData.networkId) {
+ requestingWifiConfiguration = getCurrentWifiConfiguration();
logd("id matches currentWifiConfiguration");
- } else {
- logd("id does not match targetWifiConfiguration");
+ }
+
+ if (requestingWifiConfiguration == null) {
+ logd("3GAuthRequest received with null target/current WifiConfiguration.");
return;
}
SimAuthResponseData response = mWifiCarrierInfoManager
- .get3GAuthResponse(requestData, mTargetWifiConfiguration);
+ .get3GAuthResponse(requestData, requestingWifiConfiguration);
if (response != null) {
mWifiNative.simAuthResponse(
mInterfaceName, response.type, response.response);