summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/hotspot2/omadm
diff options
context:
space:
mode:
authorJan Nordqvist <jannq@google.com>2015-06-18 14:20:19 -0700
committerJan Nordqvist <jannq@google.com>2015-07-06 17:21:38 -0700
commit07f11f6f2ee7ec17cb08180035dfb5002aaaf5df (patch)
tree8195297276449c4c9d7dd232282a77450381cd51 /service/java/com/android/server/wifi/hotspot2/omadm
parentb9766f51bcbd50f178d2c20d61f3d631c699b836 (diff)
downloadandroid_frameworks_opt_net_wifi-07f11f6f2ee7ec17cb08180035dfb5002aaaf5df.tar.gz
android_frameworks_opt_net_wifi-07f11f6f2ee7ec17cb08180035dfb5002aaaf5df.tar.bz2
android_frameworks_opt_net_wifi-07f11f6f2ee7ec17cb08180035dfb5002aaaf5df.zip
Reworked code to allow wildcard prefix IMSIs.
Change-Id: I08b7addb8dd407d9fc4f8a32a1fd2f86edde0e7a
Diffstat (limited to 'service/java/com/android/server/wifi/hotspot2/omadm')
-rw-r--r--service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java b/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java
index 63582da0b..0ea75aea0 100644
--- a/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java
+++ b/service/java/com/android/server/wifi/hotspot2/omadm/MOManager.java
@@ -3,6 +3,7 @@ package com.android.server.wifi.hotspot2.omadm;
import android.util.Base64;
import android.util.Log;
+import com.android.server.wifi.IMSIParameter;
import com.android.server.wifi.anqp.eap.EAP;
import com.android.server.wifi.anqp.eap.EAPMethod;
import com.android.server.wifi.anqp.eap.ExpandedEAPMethod;
@@ -417,7 +418,7 @@ public class MOManager {
|| method.getEAPMethodID() == EAP.EAPMethodID.EAP_AKAPrim) {
OMANode simNode = credentialNode.addChild(TAG_SIM, null, null, null);
- simNode.addChild(TAG_IMSI, null, cred.getImsi(), null);
+ simNode.addChild(TAG_IMSI, null, cred.getImsi().toString(), null);
simNode.addChild(TAG_EAPType, null,
Integer.toString(EAP.mapEAPMethod(method.getEAPMethodID())), null);
@@ -631,13 +632,18 @@ public class MOManager {
}
}
if (simNode != null) {
+ try {
+ IMSIParameter imsi = new IMSIParameter(getString(simNode.getChild(TAG_IMSI)));
- String imsi = getString(simNode.getChild(TAG_IMSI));
- EAPMethod eapMethod =
- new EAPMethod(EAP.mapEAPMethod(getInteger(simNode.getChild(TAG_EAPType))),
- null);
+ EAPMethod eapMethod =
+ new EAPMethod(EAP.mapEAPMethod(getInteger(simNode.getChild(TAG_EAPType))),
+ null);
- return new Credential(ctime, expTime, realm, checkAAACert, eapMethod, imsi);
+ return new Credential(ctime, expTime, realm, checkAAACert, eapMethod, imsi);
+ }
+ catch (IOException ioe) {
+ throw new OMAException("Failed to parse IMSI: " + ioe);
+ }
}
throw new OMAException("Missing credential parameters");
}