summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorSteven Liu <steveliu@google.com>2019-08-28 14:58:31 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-08-28 14:58:31 -0700
commitb3e52a982db6470a4514d5a3dd399fece5267348 (patch)
treeaa20c661b13559d44eb3347c595ea231765fff4e /service
parent80673cbca41c5043ade30b626779b3b5e6025208 (diff)
parent033cda1fbee42dd97da543624cd2685213f21f0e (diff)
Merge "Change system language, passpoint R2 failed to connect" into qt-qpr1-dev am: e7588d9fa3
am: 033cda1fbe Change-Id: I299d274f47e66520c2174cc27910823dc92d89e4
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java20
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java2
2 files changed, 10 insertions, 12 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java b/service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java
index f56945a98..e096b144b 100644
--- a/service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java
+++ b/service/java/com/android/server/wifi/hotspot2/OsuServerConnection.java
@@ -188,27 +188,25 @@ public class OsuServerConnection {
* Validates the service provider by comparing its identities found in OSU Server cert
* to the friendlyName obtained from ANQP exchange that is displayed to the user.
*
- * @param locale a {@link Locale} object used for matching the friendly name in
- * subjectAltName section of the certificate along with
- * {@param friendlyName}.
- * @param friendlyName a string of the friendly name used for finding the same name in
- * subjectAltName section of the certificate.
+ * @param friendlyNames the friendly names used for finding the same name in
+ * subjectAltName section of the certificate, which is a map of language
+ * codes from ISO-639 and names.
* @return boolean true if friendlyName shows up as one of the identities in the cert
*/
- public boolean validateProvider(Locale locale,
- String friendlyName) {
+ public boolean validateProvider(
+ Map<String, String> friendlyNames) {
- if (locale == null || TextUtils.isEmpty(friendlyName)) {
+ if (friendlyNames.size() == 0) {
return false;
}
for (Pair<Locale, String> identity : ServiceProviderVerifier.getProviderNames(
mTrustManager.getProviderCert())) {
- if (identity.first == null) continue;
+ if (identity.first == null || TextUtils.isEmpty(identity.second)) continue;
// Compare the language code for ISO-639.
- if (identity.first.getISO3Language().equals(locale.getISO3Language()) &&
- TextUtils.equals(identity.second, friendlyName)) {
+ if (TextUtils.equals(identity.second,
+ friendlyNames.get(identity.first.getISO3Language()))) {
if (mVerboseLoggingEnabled) {
Log.v(TAG, "OSU certificate is valid for "
+ identity.first.getISO3Language() + "/" + identity.second);
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java b/service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java
index bdd035fe4..137d9fa19 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointProvisioner.java
@@ -366,7 +366,7 @@ public class PasspointProvisioner {
return;
}
if (!mOsuServerConnection.validateProvider(
- Locale.getDefault(), mOsuProvider.getFriendlyName())) {
+ mOsuProvider.getFriendlyNameList())) {
Log.e(TAG,
"OSU Server certificate does not have the one matched with the selected "
+ "Service Name: "