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

Commit 48a7fda8 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Android (Google) Code Review
Browse files

Merge "Fix sufficient verifiers."

parents b9135c4a a925a8a4
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -6205,8 +6205,12 @@ public class PackageManagerService implements PackageSender, TestUtilityService
            mHandler.post(() -> {
                final int id = verificationId >= 0 ? verificationId : -verificationId;
                final PackageVerificationState state = mPendingVerification.get(id);
                if (state == null || !state.checkRequiredVerifierUid(callingUid)) {
                    // Only allow calls from required verifiers.
                if (state == null) {
                    return;
                }
                if (!state.checkRequiredVerifierUid(callingUid)
                        && !state.checkSufficientVerifierUid(callingUid)) {
                    // Only allow calls from verifiers.
                    return;
                }

+5 −0
Original line number Diff line number Diff line
@@ -83,6 +83,11 @@ class PackageVerificationState {
        mSufficientVerifierUids.put(uid, true);
    }

    /** Returns true if the uid a sufficient verifier. */
    boolean checkSufficientVerifierUid(int uid) {
        return mSufficientVerifierUids.get(uid, false);
    }

    /**
     * Should be called when a verification is received from an agent so the state of the package
     * verification can be tracked.