Lines Matching refs:uid

180 static int encode_key_for_uid(char* out, uid_t uid, const Value* key) {
181 int n = snprintf(out, NAME_MAX, "%u_", uid);
441 uint32_t uid;
616 uid_t uid;
617 if (!convertToUid(uidValue, &uid)) {
621 grant_t *grant = getGrant(filename, uid);
624 grant->uid = uid;
631 uid_t uid;
632 if (!convertToUid(uidValue, &uid)) {
636 grant_t *grant = getGrant(filename, uid);
646 bool hasGrant(const char* filename, const uid_t uid) const {
647 return getGrant(filename, uid) != NULL;
748 grant_t* getGrant(const char* filename, uid_t uid) const {
754 if (grant->uid == uid
764 bool convertToUid(const Value* uidValue, uid_t* uid) const {
767 *uid = strtol(uidString.c_str(), &end, 10);
896 const uid_t uid, const BlobType type) {
899 encode_key_for_uid(filename, uid, keyName);
907 if (uid == AID_WIFI || uid == AID_VPN) {
917 if (!keyStore->hasGrant(filename, uid)) {
939 static ResponseCode get(KeyStore* keyStore, int sock, uid_t uid, Value* keyName, Value*, Value*) {
941 encode_key_for_uid(filename, uid, keyName);
952 static ResponseCode insert(KeyStore* keyStore, int, uid_t uid, Value* keyName, Value* val,
955 encode_key_for_uid(filename, uid, keyName);
960 static ResponseCode del(KeyStore* keyStore, int, uid_t uid, Value* keyName, Value*, Value*) {
962 encode_key_for_uid(filename, uid, keyName);
971 static ResponseCode exist(KeyStore*, int, uid_t uid, Value* keyName, Value*, Value*) {
973 encode_key_for_uid(filename, uid, keyName);
980 static ResponseCode saw(KeyStore*, int sock, uid_t uid, Value* keyPrefix, Value*, Value*) {
986 int n = encode_key_for_uid(filename, uid, keyPrefix);
1052 static ResponseCode unlock(KeyStore* keyStore, int sock, uid_t uid, Value* pw, Value* unused,
1054 return password(keyStore, sock, uid, pw, unused, unused2);
1061 static ResponseCode generate(KeyStore* keyStore, int, uid_t uid, Value* keyName, Value*,
1086 encode_key_for_uid(filename, uid, keyName);
1094 static ResponseCode import(KeyStore* keyStore, int, uid_t uid, Value* keyName, Value* key,
1098 encode_key_for_uid(filename, uid, keyName);
1114 static ResponseCode get_pubkey(KeyStore* keyStore, int sock, uid_t uid, Value* keyName, Value*, Value*) {
1116 ALOGV("get_pubkey '%s' from uid %d", ValueString(keyName).c_str(), uid);
1118 ResponseCode responseCode = get_key_for_name(keyStore, &keyBlob, keyName, uid, TYPE_KEY_PAIR);
1149 static ResponseCode del_key(KeyStore* keyStore, int, uid_t uid, Value* keyName, Value*,
1152 encode_key_for_uid(filename, uid, keyName);
1180 static ResponseCode sign(KeyStore* keyStore, int sock, uid_t uid, Value* keyName, Value* data,
1182 ALOGV("sign %s from uid %d", ValueString(keyName).c_str(), uid);
1186 ResponseCode responseCode = get_key_for_name(keyStore, &keyBlob, keyName, uid, TYPE_KEY_PAIR);
1221 static ResponseCode verify(KeyStore* keyStore, int, uid_t uid, Value* keyName, Value* data,
1226 ResponseCode responseCode = get_key_for_name(keyStore, &keyBlob, keyName, uid, TYPE_KEY_PAIR);
1253 static ResponseCode grant(KeyStore* keyStore, int, uid_t uid, Value* keyName,
1256 encode_key_for_uid(filename, uid, keyName);
1265 static ResponseCode ungrant(KeyStore* keyStore, int, uid_t uid, Value* keyName,
1268 encode_key_for_uid(filename, uid, keyName);
1276 static ResponseCode getmtime(KeyStore*, int sock, uid_t uid, Value* keyName,
1279 encode_key_for_uid(filename, uid, keyName);
1332 ResponseCode (*run)(KeyStore* keyStore, int sock, uid_t uid, Value* param1, Value* param2,
1363 uid_t uid;
1375 static ResponseCode process(KeyStore* keyStore, int sock, uid_t uid, int8_t code) {
1380 while (~user->uid && user->uid != (uid % AID_USER)) {
1396 uid = user->euid;
1408 return action->run(keyStore, sock, uid, &params[0], &params[1], &params[2]);
1457 ResponseCode response = process(&keyStore, sock, cred.uid, request);
1463 ALOGI("uid: %d action: %c -> %d state: %d -> %d retry: %d",
1464 cred.uid,