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

Commit 416747ae authored by Carlos Valdivia's avatar Carlos Valdivia
Browse files

Package checks for resloving recovery tokens should be user sensitive.

Bug: 11219355
Change-Id: Iec031739dc0d751ee9841ca2c495a346d689ad2a
parent a6ffa4ef
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -2167,16 +2167,21 @@ public class AccountManagerService
                 * this can be very bad when those apps are in the system like
                 * the System Settings.
                 */
                int authenticatorUid = Binder.getCallingUid();
                long bid = Binder.clearCallingIdentity();
                try {
                    PackageManager pm = mContext.getPackageManager();
                ResolveInfo resolveInfo = pm.resolveActivity(intent, 0);
                    ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId);
                    int targetUid = resolveInfo.activityInfo.applicationInfo.uid;
                int authenticatorUid = Binder.getCallingUid();
                    if (PackageManager.SIGNATURE_MATCH !=
                            pm.checkSignatures(authenticatorUid, targetUid)) {
                        throw new SecurityException(
                                "Activity to be started with KEY_INTENT must " +
                               "share Authenticator's signatures");
                    }
                } finally {
                    Binder.restoreCallingIdentity(bid);
                }
            }
            if (result != null
                    && !TextUtils.isEmpty(result.getString(AccountManager.KEY_AUTHTOKEN))) {