summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eric Biggers <ebiggers@google.com> 2023-10-09 20:51:48 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-10-09 20:51:48 +0000
commit615ca048a5deac1327bc68b0fe16c24fd2295c1f (patch)
treeee847e974c085de5e1255084e819cb2c0c436b0f
parentf48ae1473a76ec6bf7b160c1b7cc85941e219d96 (diff)
parent2b32467e37e59ed4fa73f50fe1ad66c39734589c (diff)
Remove PasswordMetrics#validatePassword() am: 2b32467e37
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2775383 Change-Id: I8190aea5c14fc537e3ec356413c91e1c1b36e57a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--core/java/android/app/admin/PasswordMetrics.java37
1 files changed, 0 insertions, 37 deletions
diff --git a/core/java/android/app/admin/PasswordMetrics.java b/core/java/android/app/admin/PasswordMetrics.java
index 9b64d8fe84b4..93c0c8a4a47a 100644
--- a/core/java/android/app/admin/PasswordMetrics.java
+++ b/core/java/android/app/admin/PasswordMetrics.java
@@ -135,17 +135,6 @@ public final class PasswordMetrics implements Parcelable {
}
}
- private static boolean hasInvalidCharacters(byte[] password) {
- // Allow non-control Latin-1 characters only.
- for (byte b : password) {
- char c = (char) b;
- if (c < 32 || c > 127) {
- return true;
- }
- }
- return false;
- }
-
@Override
public int describeContents() {
return 0;
@@ -537,32 +526,6 @@ public final class PasswordMetrics implements Parcelable {
}
/**
- * Validates a proposed lockscreen credential against minimum metrics and complexity.
- *
- * @param adminMetrics minimum metrics to satisfy admin requirements
- * @param minComplexity minimum complexity imposed by the requester
- * @param isPin whether to validate as a PIN (true) or password (false)
- * @param password the proposed lockscreen credential as a byte[]. Must be the value from
- * {@link LockscreenCredential#getCredential()}.
- *
- * @return a list of validation errors. An empty list means the credential is OK.
- *
- * TODO: merge this into validateCredential() and remove the redundant hasInvalidCharacters(),
- * once all external callers are removed
- */
- public static List<PasswordValidationError> validatePassword(
- PasswordMetrics adminMetrics, int minComplexity, boolean isPin, byte[] password) {
-
- if (hasInvalidCharacters(password)) {
- return Collections.singletonList(
- new PasswordValidationError(CONTAINS_INVALID_CHARACTERS, 0));
- }
-
- final PasswordMetrics enteredMetrics = computeForPasswordOrPin(password, isPin);
- return validatePasswordMetrics(adminMetrics, minComplexity, enteredMetrics);
- }
-
- /**
* Validates password metrics against minimum metrics and complexity
*
* @param adminMetrics - minimum metrics to satisfy admin requirements.