Lines Matching refs:uid
161 uid_t uid;
193 uid_t uid;
220 * UNIX UID.
222 static uid_t get_app_id(uid_t uid) {
223 return uid % AID_USER;
228 * UNIX UID.
230 static uid_t get_user_id(uid_t uid) {
231 return uid / AID_USER;
234 static bool keystore_selinux_check_access(uid_t uid, perm_t perm, pid_t spid) {
258 static bool has_permission(uid_t uid, perm_t perm, pid_t spid) {
260 if (get_app_id(uid) == AID_SYSTEM) {
261 uid = AID_SYSTEM;
266 if (user.uid == uid) {
268 keystore_selinux_check_access(uid, perm, spid);
273 keystore_selinux_check_access(uid, perm, spid);
277 * Returns the UID that the callingUid should act as. This is here for
281 static uid_t get_keystore_euid(uid_t uid) {
284 if (user.uid == uid) {
289 return uid;
299 if (user.euid == callingUid && user.uid == targetUid) {
941 uint32_t uid;
981 State getState(uid_t uid) {
982 return getUserState(uid)->getState();
985 ResponseCode initializeUser(const android::String8& pw, uid_t uid) {
986 UserState* userState = getUserState(uid);
990 ResponseCode copyMasterKey(uid_t src, uid_t uid) {
991 UserState *userState = getUserState(uid);
996 ResponseCode writeMasterKey(const android::String8& pw, uid_t uid) {
997 UserState* userState = getUserState(uid);
1001 ResponseCode readMasterKey(const android::String8& pw, uid_t uid) {
1002 UserState* userState = getUserState(uid);
1012 android::String8 getKeyNameForUid(const android::String8& keyName, uid_t uid) {
1015 return android::String8::format("%u_%s", uid, encoded);
1018 android::String8 getKeyNameForUidWithDir(const android::String8& keyName, uid_t uid) {
1021 return android::String8::format("%s/%u_%s", getUserState(uid)->getUserDirName(), uid,
1025 bool reset(uid_t uid) {
1028 if (saw(prefix, &aliases, uid) != ::NO_ERROR) {
1032 UserState* userState = getUserState(uid);
1037 del(filename, ::TYPE_ANY, uid);
1045 bool isEmpty(uid_t uid) const {
1046 const UserState* userState = getUserState(uid);
1076 void lock(uid_t uid) {
1077 UserState* userState = getUserState(uid);
1082 ResponseCode get(const char* filename, Blob* keyBlob, const BlobType type, uid_t uid) {
1083 UserState* userState = getUserState(uid);
1096 if (upgradeBlob(filename, keyBlob, version, type, uid)) {
1097 if ((rc = this->put(filename, keyBlob, uid)) != NO_ERROR
1113 uid, keyBlob->isEncrypted() ? KEYSTORE_FLAG_ENCRYPTED : KEYSTORE_FLAG_NONE);
1118 rc = get(filename, keyBlob, TYPE_KEY_PAIR, uid);
1130 ResponseCode put(const char* filename, Blob* keyBlob, uid_t uid) {
1131 UserState* userState = getUserState(uid);
1136 ResponseCode del(const char *filename, const BlobType type, uid_t uid) {
1138 ResponseCode rc = get(filename, &keyBlob, type, uid);
1159 uid_t uid) {
1161 UserState* userState = getUserState(uid);
1205 grant->uid = granteeUid;
1215 if (grant->uid == granteeUid
1224 bool hasGrant(const char* filename, const uid_t uid) const {
1225 return getGrant(filename, uid) != NULL;
1228 ResponseCode importKey(const uint8_t* key, size_t keyLen, const char* filename, uid_t uid,
1263 return put(filename, &keyBlob, uid);
1281 ResponseCode getKeyForName(Blob* keyBlob, const android::String8& keyName, const uid_t uid,
1283 android::String8 filepath8(getKeyNameForUidWithDir(keyName, uid));
1285 ResponseCode responseCode = get(filepath8.string(), keyBlob, type, uid);
1290 // If this is one of the legacy UID->UID mappings, use it.
1291 uid_t euid = get_keystore_euid(uid);
1292 if (euid != uid) {
1294 responseCode = get(filepath8.string(), keyBlob, type, uid);
1307 filepath8 = android::String8::format("%s/%s", getUserState(uid)->getUserDirName(),
1309 if (!hasGrant(filepath8.string(), uid)) {
1314 return get(filepath8.string(), keyBlob, type, uid);
1320 UserState* getUserState(uid_t uid) {
1321 uid_t userId = get_user_id(uid);
1346 const UserState* getUserState(uid_t uid) const {
1347 uid_t userId = get_user_id(uid);
1378 const grant_t* getGrant(const char* filename, uid_t uid) const {
1382 if (grant->uid == uid
1395 const BlobType type, uid_t uid) {
1405 importBlobAsKey(blob, filename, uid);
1438 ResponseCode importBlobAsKey(Blob* blob, const char* filename, uid_t uid) {
1466 ResponseCode rc = importKey(pkcs8key.get(), len, filename, uid,
1472 return get(filename, blob, TYPE_KEY_PAIR, uid);
2010 ALOGV("sign %s from uid %d", name8.string(), callingUid);
2123 ALOGV("get_pubkey '%s' from uid %d", name8.string(), callingUid);
2285 ALOGD("can only duplicate from caller to other or to same uid: "