summaryrefslogtreecommitdiff
path: root/wifi/java
diff options
context:
space:
mode:
Diffstat (limited to 'wifi/java')
-rw-r--r--wifi/java/android/net/wifi/WifiEnterpriseConfig.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
index abd573f4bea9..d35ce3c7a42c 100644
--- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
+++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java
@@ -1425,10 +1425,19 @@ public class WifiEnterpriseConfig implements Parcelable {
if (mEapMethod != Eap.PEAP && mEapMethod != Eap.TLS && mEapMethod != Eap.TTLS) {
return false;
}
- if (!mIsAppInstalledCaCert && TextUtils.isEmpty(getCaPath())) {
+ if (TextUtils.isEmpty(getAltSubjectMatch())
+ && TextUtils.isEmpty(getDomainSuffixMatch())) {
+ // Both subject and domain match are not set, it's insecure.
return true;
}
- return TextUtils.isEmpty(getAltSubjectMatch()) && TextUtils.isEmpty(
- getDomainSuffixMatch());
+ if (mIsAppInstalledCaCert) {
+ // CA certificate is installed by App, it's secure.
+ return false;
+ }
+ if (getCaCertificateAliases() != null) {
+ // CA certificate alias from keyStore is set, it's secure.
+ return false;
+ }
+ return TextUtils.isEmpty(getCaPath());
}
}