Home | History | Annotate | Download | only in keystore

Lines Matching defs:uid

156     uid_t uid;
165 uid_t uid;
179 * UNIX UID.
181 static uid_t get_app_id(uid_t uid) {
182 return uid % AID_USER;
187 * UNIX UID.
189 static uid_t get_user_id(uid_t uid) {
190 return uid / AID_USER;
194 static bool has_permission(uid_t uid, perm_t perm) {
196 if (get_app_id(uid) == AID_SYSTEM) {
197 uid = AID_SYSTEM;
202 if (user.uid == uid) {
211 * Returns the UID that the callingUid should act as. This is here for
215 static uid_t get_keystore_euid(uid_t uid) {
218 if (user.uid == uid) {
223 return uid;
233 if (user.euid == callingUid && user.uid == targetUid) {
789 // Find the current file's UID.
866 uint32_t uid;
906 State getState(uid_t uid) {
907 return getUserState(uid)->getState();
910 ResponseCode initializeUser(const android::String8& pw, uid_t uid) {
911 UserState* userState = getUserState(uid);
915 ResponseCode writeMasterKey(const android::String8& pw, uid_t uid) {
916 uid_t user_id = get_user_id(uid);
921 ResponseCode readMasterKey(const android::String8& pw, uid_t uid) {
922 uid_t user_id = get_user_id(uid);
933 android::String8 getKeyNameForUid(const android::String8& keyName, uid_t uid) {
936 return android::String8::format("%u_%s", uid, encoded);
939 android::String8 getKeyNameForUidWithDir(const android::String8& keyName, uid_t uid) {
942 return android::String8::format("%s/%u_%s", getUserState(uid)->getUserDirName(), uid,
946 bool reset(uid_t uid) {
947 UserState* userState = getUserState(uid);
953 bool isEmpty(uid_t uid) const {
954 const UserState* userState = getUserState(uid);
967 int n = snprintf(filename, sizeof(filename), "%u_", uid);
989 void lock(uid_t uid) {
990 UserState* userState = getUserState(uid);
995 ResponseCode get(const char* filename, Blob* keyBlob, const BlobType type, uid_t uid) {
996 UserState* userState = getUserState(uid);
1009 if (upgradeBlob(filename, keyBlob, version, type, uid)) {
1010 if ((rc = this->put(filename, keyBlob, uid)) != NO_ERROR
1026 uid, keyBlob->isEncrypted() ? KEYSTORE_FLAG_ENCRYPTED : KEYSTORE_FLAG_NONE);
1031 rc = get(filename, keyBlob, TYPE_KEY_PAIR, uid);
1043 ResponseCode put(const char* filename, Blob* keyBlob, uid_t uid) {
1044 UserState* userState = getUserState(uid);
1053 grant->uid = granteeUid;
1063 if (grant->uid == granteeUid
1072 bool hasGrant(const char* filename, const uid_t uid) const {
1073 return getGrant(filename, uid) != NULL;
1076 uid,
1108 return put(filename, &keyBlob, uid);
1126 ResponseCode getKeyForName(Blob* keyBlob, const android::String8& keyName, const uid_t uid,
1128 android::String8 filepath8(getKeyNameForUidWithDir(keyName, uid));
1130 ResponseCode responseCode = get(filepath8.string(), keyBlob, type, uid);
1135 // If this is one of the legacy UID->UID mappings, use it.
1136 uid_t euid = get_keystore_euid(uid);
1137 if (euid != uid) {
1139 responseCode = get(filepath8.string(), keyBlob, type, uid);
1152 filepath8 = android::String8::format("%s/%s", getUserState(uid)->getUserDirName(),
1154 if (!hasGrant(filepath8.string(), uid)) {
1159 return get(filepath8.string(), keyBlob, type, uid);
1165 UserState* getUserState(uid_t uid) {
1166 uid_t userId = get_user_id(uid);
1191 const UserState* getUserState(uid_t uid) const {
1192 uid_t userId = get_user_id(uid);
1223 const grant_t* getGrant(const char* filename, uid_t uid) const {
1227 if (grant->uid == uid
1240 const BlobType type, uid_t uid) {
1250 importBlobAsKey(blob, filename, uid);
1283 ResponseCode importBlobAsKey(Blob* blob, const char* filename, uid_t uid) {
1311 ResponseCode rc = importKey(pkcs8key.get(), len, filename, uid,
1317 return get(filename, blob, TYPE_KEY_PAIR, uid);
1900 ALOGV("sign %s from uid %d", name8.string(), callingUid);
2011 ALOGV("get_pubkey '%s' from uid %d", name8.string(), callingUid);
2194 ALOGD("can only duplicate from caller to other or to same uid: "