Merge "Clear identity when checking strongauth flags" into rvc-qpr-dev am: 90c7090ebf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12193571

Change-Id: I3b46e293afab173f951c178c54a6402e1bae4928
This commit is contained in:
Kevin Chyn
2020-07-20 20:54:19 +00:00
committed by Automerger Merge Worker

View File

@@ -247,13 +247,22 @@ public class FingerprintService extends BiometricServiceBase {
public void authenticate(final IBinder token, final long opId, final int userId, public void authenticate(final IBinder token, final long opId, final int userId,
final IFingerprintServiceReceiver receiver, final int flags, final IFingerprintServiceReceiver receiver, final int flags,
final String opPackageName) { final String opPackageName) {
if (Utils.isUserEncryptedOrLockdown(mLockPatternUtils, userId) // Keyguard check must be done on the caller's binder identity, since it also checks
&& Utils.isKeyguard(getContext(), opPackageName)) { // permission.
// If this happens, something in KeyguardUpdateMonitor is wrong. final boolean isKeyguard = Utils.isKeyguard(getContext(), opPackageName);
// SafetyNet for b/79776455
EventLog.writeEvent(0x534e4554, "79776455"); // Clear calling identity when checking LockPatternUtils for StrongAuth flags.
Slog.e(TAG, "Authenticate invoked when user is encrypted or lockdown"); final long identity = Binder.clearCallingIdentity();
return; try {
if (isKeyguard && Utils.isUserEncryptedOrLockdown(mLockPatternUtils, userId)) {
// If this happens, something in KeyguardUpdateMonitor is wrong.
// SafetyNet for b/79776455
EventLog.writeEvent(0x534e4554, "79776455");
Slog.e(TAG, "Authenticate invoked when user is encrypted or lockdown");
return;
}
} finally {
Binder.restoreCallingIdentity(identity);
} }
updateActiveGroup(userId, opPackageName); updateActiveGroup(userId, opPackageName);