diff options
Diffstat (limited to 'wifi/java')
-rw-r--r-- | wifi/java/android/net/wifi/WifiEnterpriseConfig.java | 15 |
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 7b86b084baab..252165f5aa66 100644 --- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java +++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java @@ -1397,10 +1397,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()); } } |