Merge "Fix sufficient verifiers."
This commit is contained in:
committed by
Android (Google) Code Review
commit
48a7fda811
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user