Fixed binding issue.

Updating cert and key for EAP-TLS during remediation.
Fixed WNM remediation logic.

Bug=28885285
Bug=27485600
Bug=27485524

Change-Id: I1272d8d004a8fd9853f80e951531c0b67ddf34e3
This commit is contained in:
Jan Nordqvist
2016-05-17 17:37:18 -07:00
parent 4c4d76a9bd
commit 620c920579
4 changed files with 24 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_MODULE_TAGS := optional

View File

@@ -29,7 +29,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<application
android:enabled="true"
android:enabled="true"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@@ -46,10 +46,10 @@
</activity>
<activity android:name="com.android.hotspot2.osu.OSUWebView">
</activity>
<service android:name=".app.OSUService">
</service>
<service android:name=".flow.FlowService" android:process=":osuflow">
</service>
<service android:name=".app.OSUService" android:directBootAware="true">
</service>
<service android:name=".flow.FlowService" android:process=":osuflow">
</service>
</application>
</manifest>

View File

@@ -365,6 +365,13 @@ public class PlatformAdapter {
altSP = homeSP;
}
updateNetwork(altSP, caCert, clientCerts, privateKey);
if (privateKey != null) {
X509Certificate cltCert = getCert(certs, OSUCertType.Client);
mKeyStore.setKeyEntry(CERT_CLT_KEY_ALIAS + homeSP.getFQDN(),
privateKey, null, new X509Certificate[]{cltCert});
mKeyStore.setCertificateEntry(CERT_CLT_CERT_ALIAS + homeSP.getFQDN(), cltCert);
}
}
Intent intent = new Intent(OSUService.REMEDIATION_DONE_ACTION);

View File

@@ -135,13 +135,17 @@ public class RemediationHandler implements AlarmManager.OnAlarmListener {
WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
try {
if (mActivePasspointConfig != null
&& update.matches(wifiInfo, mActivePasspointConfig.getHomeSP())) {
Log.d(OSUManager.TAG, "WNM frame received, remediating now");
if (mActivePasspointConfig == null) {
Log.d(OSUManager.TAG, String.format("WNM remediation frame '%s' through %012x " +
"received, adding to outstanding remediations", url, bssid));
mOutstanding.addFirst(new PendingUpdate(bssid, url));
} else if (update.matches(wifiInfo, mActivePasspointConfig.getHomeSP())) {
Log.d(OSUManager.TAG, String.format("WNM remediation frame '%s' through %012x " +
"received, remediating now", url, bssid));
update.remediate(wifiManager.getCurrentNetwork());
} else {
Log.d(OSUManager.TAG, "WNM frame received, adding to outstanding remediations");
mOutstanding.addFirst(new PendingUpdate(bssid, url));
Log.w(OSUManager.TAG, String.format("WNM remediation frame '%s' through %012x " +
"does not meet restriction", url, bssid));
}
} catch (IOException ioe) {
Log.w(OSUManager.TAG, "Failed to remediate from WNM: " + ioe);
@@ -497,8 +501,8 @@ public class RemediationHandler implements AlarmManager.OnAlarmListener {
Log.d(OSUManager.TAG, String.format("Checking applicability of %s to %012x\n",
wifiInfo != null ? wifiInfo.getBSSID() : "-", mBssid));
return wifiInfo != null
&& Utils.parseMac(wifiInfo.getBSSID()) == mBssid;
//&& passesRestriction(activeSP); // !!! b/28600780
&& Utils.parseMac(wifiInfo.getBSSID()) == mBssid
&& passesRestriction(activeSP); // !!! b/28600780
} else {
return passesRestriction(mHomeSP);
}