summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorPavel Maltsev <pavelm@google.com>2019-10-18 11:20:04 -0700
committerPavel Maltsev <pavelm@google.com>2019-10-18 11:22:42 -0700
commit84e8559b70cc419e9b3a3d23dd74e09781e9ee0f (patch)
treeb39469be669ab488fec112c9e445d711783bf9f5 /service
parent4b439b9cfa18bafdaf97001f9ab795a3090cdb00 (diff)
Generate stronger default password for tethered AP
Increase password entropy for tethered hotspot to 2^75 (used to be 2^48). The password length is increased to 15 chars from range a-z, 0-9 (minus symbols that may look confusing on the screen). Bug: 142068677 Test: atest com.android.server.wifi Change-Id: Iae488b8dfceb6a2f5ccf476af8eabcfc03507bdf
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiApConfigStore.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiApConfigStore.java b/service/java/com/android/server/wifi/WifiApConfigStore.java
index 4db12d574..87a170c78 100644
--- a/service/java/com/android/server/wifi/WifiApConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiApConfigStore.java
@@ -47,7 +47,6 @@ import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Random;
-import java.util.UUID;
/**
* Provides API for reading/writing soft access point configuration.
@@ -344,9 +343,7 @@ public class WifiApConfigStore {
config.SSID = mContext.getResources().getString(
R.string.wifi_tether_configure_ssid_default) + "_" + getRandomIntForDefaultSsid();
config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
- String randomUUID = UUID.randomUUID().toString();
- //first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
- config.preSharedKey = randomUUID.substring(0, 8) + randomUUID.substring(9, 13);
+ config.preSharedKey = generatePassword();
return config;
}