Merge "Revert "Checks WEP password lengths of Wi-Fi network"" into main

This commit is contained in:
Treehugger Robot
2024-05-09 08:00:14 +00:00
committed by Android (Google) Code Review
2 changed files with 1 additions and 40 deletions

View File

@@ -514,12 +514,6 @@ public class WifiConfigController2 implements TextWatcher,
submit.setEnabled(isSubmittable());
}
boolean isValidWepPassword(String password) {
// Checks for WEP40 and WEP104 password lengths (5 and 13 bytes)
int passwordLen = (password != null) ? password.length() : -1;
return passwordLen == 5 || passwordLen == 13;
}
boolean isValidPsk(String password) {
if (password.length() == 64 && password.matches("[0-9A-Fa-f]{64}")) {
return true;
@@ -541,7 +535,7 @@ public class WifiConfigController2 implements TextWatcher,
boolean passwordInvalid = false;
if (mPasswordView != null
&& ((mWifiEntrySecurity == WifiEntry.SECURITY_WEP
&& !isValidWepPassword(mPasswordView.getText().toString()))
&& mPasswordView.length() == 0)
|| (mWifiEntrySecurity == WifiEntry.SECURITY_PSK
&& !isValidPsk(mPasswordView.getText().toString()))
|| (mWifiEntrySecurity == WifiEntry.SECURITY_SAE