Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dccc4a83 authored by Paul Crowley's avatar Paul Crowley Committed by Android (Google) Code Review
Browse files

Merge "Always get an auth token when we verify."

parents 62cd9e4a 98e0a266
Loading
Loading
Loading
Loading
+15 −30
Original line number Diff line number Diff line
@@ -762,16 +762,14 @@ public class LockSettingsService extends ILockSettings.Stub {
        }

        VerifyCredentialResponse response;
        boolean shouldReEnroll = false;;
        if (hasChallenge) {
            byte[] token = null;
        boolean shouldReEnroll = false;
        GateKeeperResponse gateKeeperResponse = getGateKeeperService()
                .verifyChallenge(userId, challenge, storedHash.hash, credential.getBytes());
        int responseCode = gateKeeperResponse.getResponseCode();
        if (responseCode == GateKeeperResponse.RESPONSE_RETRY) {
             response = new VerifyCredentialResponse(gateKeeperResponse.getTimeout());
        } else if (responseCode == GateKeeperResponse.RESPONSE_OK) {
                token = gateKeeperResponse.getPayload();
            byte[] token = gateKeeperResponse.getPayload();
            if (token == null) {
                // something's wrong if there's no payload with a challenge
                Slog.e(TAG, "verifyChallenge response had no associated payload");
@@ -783,19 +781,6 @@ public class LockSettingsService extends ILockSettings.Stub {
        } else {
            response = VerifyCredentialResponse.ERROR;
        }
        } else {
            GateKeeperResponse gateKeeperResponse = getGateKeeperService().verify(
                    userId, storedHash.hash, credential.getBytes());
            int responseCode = gateKeeperResponse.getResponseCode();
            if (responseCode == GateKeeperResponse.RESPONSE_RETRY) {
                response = new VerifyCredentialResponse(gateKeeperResponse.getTimeout());
            } else if (responseCode == GateKeeperResponse.RESPONSE_OK) {
                shouldReEnroll = gateKeeperResponse.getShouldReEnroll();
                response = VerifyCredentialResponse.OK;
            } else {
                response = VerifyCredentialResponse.ERROR;
            }
        }

        if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) {
            // credential has matched