Home | History | Annotate | Download | only in keystore

Lines Matching refs:uid

145     uid_t uid;
154 uid_t uid;
168 * UNIX UID.
170 static uid_t get_app_id(uid_t uid) {
171 return uid % AID_USER;
176 * UNIX UID.
178 static uid_t get_user_id(uid_t uid) {
179 return uid / AID_USER;
183 static bool has_permission(uid_t uid, perm_t perm) {
185 if (get_app_id(uid) == AID_SYSTEM) {
186 uid = AID_SYSTEM;
191 if (user.uid == uid) {
200 * Returns the UID that the callingUid should act as. This is here for
204 static uid_t get_keystore_euid(uid_t uid) {
207 if (user.uid == uid) {
212 return uid;
222 if (user.euid == callingUid && user.uid == targetUid) {
264 static int encode_key_for_uid(char* out, uid_t uid, const android::String8& keyName) {
265 int n = snprintf(out, NAME_MAX, "%u_", uid);
769 // Find the current file's UID.
846 uint32_t uid;
886 State getState(uid_t uid) {
887 return getUserState(uid)->getState();
890 ResponseCode initializeUser(const android::String8& pw, uid_t uid) {
891 UserState* userState = getUserState(uid);
895 ResponseCode writeMasterKey(const android::String8& pw, uid_t uid) {
896 uid_t user_id = get_user_id(uid);
901 ResponseCode readMasterKey(const android::String8& pw, uid_t uid) {
902 uid_t user_id = get_user_id(uid);
913 android::String8 getKeyNameForUid(const android::String8& keyName, uid_t uid) {
916 return android::String8::format("%u_%s", uid, encoded);
919 android::String8 getKeyNameForUidWithDir(const android::String8& keyName, uid_t uid) {
922 return android::String8::format("%s/%u_%s", getUserState(uid)->getUserDirName(), uid,
926 bool reset(uid_t uid) {
927 UserState* userState = getUserState(uid);
933 bool isEmpty(uid_t uid) const {
934 const UserState* userState = getUserState(uid);
947 int n = snprintf(filename, sizeof(filename), "%u_", uid);
969 void lock(uid_t uid) {
970 UserState* userState = getUserState(uid);
975 ResponseCode get(const char* filename, Blob* keyBlob, const BlobType type, uid_t uid) {
976 UserState* userState = getUserState(uid);
989 if (upgradeBlob(filename, keyBlob, version, type, uid)) {
990 if ((rc = this->put(filename, keyBlob, uid)) != NO_ERROR
1006 ResponseCode put(const char* filename, Blob* keyBlob, uid_t uid) {
1007 UserState* userState = getUserState(uid);
1016 grant->uid = granteeUid;
1026 if (grant->uid == granteeUid
1035 bool hasGrant(const char* filename, const uid_t uid) const {
1036 return getGrant(filename, uid) != NULL;
1039 ResponseCode importKey(const uint8_t* key, size_t keyLen, const char* filename, uid_t uid,
1061 return put(filename, &keyBlob, uid);
1068 ResponseCode getKeyForName(Blob* keyBlob, const android::String8& keyName, const uid_t uid,
1071 encode_key_for_uid(filename, uid, keyName);
1073 UserState* userState = getUserState(uid);
1082 ResponseCode responseCode = get(filepath8.string(), keyBlob, type, uid);
1087 // If this is one of the legacy UID->UID mappings, use it.
1088 uid_t euid = get_keystore_euid(uid);
1089 if (euid != uid) {
1092 responseCode = get(filepath8.string(), keyBlob, type, uid);
1106 if (!hasGrant(filepath8.string(), uid)) {
1111 return get(filepath8.string(), keyBlob, type, uid);
1117 UserState* getUserState(uid_t uid) {
1118 uid_t userId = get_user_id(uid);
1143 const UserState* getUserState(uid_t uid) const {
1144 uid_t userId = get_user_id(uid);
1174 const grant_t* getGrant(const char* filename, uid_t uid) const {
1178 if (grant->uid == uid
1191 const BlobType type, uid_t uid) {
1201 importBlobAsKey(blob, filename, uid);
1234 ResponseCode importBlobAsKey(Blob* blob, const char* filename, uid_t uid) {
1262 ResponseCode rc = importKey(pkcs8key.get(), len, filename, uid,
1268 return get(filename, blob, TYPE_KEY_PAIR, uid);
1746 ALOGV("sign %s from uid %d", name8.string(), callingUid);
1847 ALOGV("get_pubkey '%s' from uid %d", name8.string(), callingUid);
2024 ALOGD("can only duplicate from caller to other or to same uid: "