Loading wifi/java/android/net/wifi/WifiEnterpriseConfig.java +8 −3 Original line number Original line Diff line number Diff line Loading @@ -412,11 +412,15 @@ public class WifiEnterpriseConfig implements Parcelable { * @throws IllegalArgumentException if not a CA certificate * @throws IllegalArgumentException if not a CA certificate */ */ public void setCaCertificate(X509Certificate cert) { public void setCaCertificate(X509Certificate cert) { if (cert != null) { if (cert.getBasicConstraints() >= 0) { if (cert.getBasicConstraints() >= 0) { mCaCert = cert; mCaCert = cert; } else { } else { throw new IllegalArgumentException("Not a CA certificate"); throw new IllegalArgumentException("Not a CA certificate"); } } } else { mCaCert = null; } } } /** /** Loading Loading @@ -679,6 +683,7 @@ public class WifiEnterpriseConfig implements Parcelable { } } private String removeDoubleQuotes(String string) { private String removeDoubleQuotes(String string) { if (TextUtils.isEmpty(string)) return ""; int length = string.length(); int length = string.length(); if ((length > 1) && (string.charAt(0) == '"') if ((length > 1) && (string.charAt(0) == '"') && (string.charAt(length - 1) == '"')) { && (string.charAt(length - 1) == '"')) { Loading Loading
wifi/java/android/net/wifi/WifiEnterpriseConfig.java +8 −3 Original line number Original line Diff line number Diff line Loading @@ -412,11 +412,15 @@ public class WifiEnterpriseConfig implements Parcelable { * @throws IllegalArgumentException if not a CA certificate * @throws IllegalArgumentException if not a CA certificate */ */ public void setCaCertificate(X509Certificate cert) { public void setCaCertificate(X509Certificate cert) { if (cert != null) { if (cert.getBasicConstraints() >= 0) { if (cert.getBasicConstraints() >= 0) { mCaCert = cert; mCaCert = cert; } else { } else { throw new IllegalArgumentException("Not a CA certificate"); throw new IllegalArgumentException("Not a CA certificate"); } } } else { mCaCert = null; } } } /** /** Loading Loading @@ -679,6 +683,7 @@ public class WifiEnterpriseConfig implements Parcelable { } } private String removeDoubleQuotes(String string) { private String removeDoubleQuotes(String string) { if (TextUtils.isEmpty(string)) return ""; int length = string.length(); int length = string.length(); if ((length > 1) && (string.charAt(0) == '"') if ((length > 1) && (string.charAt(0) == '"') && (string.charAt(length - 1) == '"')) { && (string.charAt(length - 1) == '"')) { Loading