Lines Matching refs:filename
580 ResponseCode writeBlob(const char* filename, AES_KEY *aes_key, State state, Entropy* entropy) { in writeBlob() argument
581 ALOGV("writing blob %s", filename); in writeBlob()
589 ALOGW("Could not read random data for: %s", filename); in writeBlob()
636 if (rename(tmpFileName, filename) == -1) { in writeBlob()
637 ALOGW("could not rename blob to %s: %s", filename, strerror(errno)); in writeBlob()
643 ResponseCode readBlob(const char* filename, AES_KEY *aes_key, State state) { in readBlob() argument
644 ALOGV("reading blob %s", filename); in readBlob()
645 int in = TEMP_FAILURE_RETRY(open(filename, O_RDONLY)); in readBlob()
950 const uint8_t* filename; member
1042 android::String8 filename(aliases[i]); in reset() local
1043 filename = android::String8::format("%s/%s", userState->getUserDirName(), in reset()
1044 getKeyName(filename).string()); in reset()
1045 del(filename, ::TYPE_ANY, uid); in reset()
1090 ResponseCode get(const char* filename, Blob* keyBlob, const BlobType type, uid_t uid) { in get() argument
1092 ResponseCode rc = keyBlob->readBlob(filename, userState->getDecryptionKey(), in get()
1104 if (upgradeBlob(filename, keyBlob, version, type, uid)) { in get()
1105 if ((rc = this->put(filename, keyBlob, uid)) != NO_ERROR in get()
1106 || (rc = keyBlob->readBlob(filename, userState->getDecryptionKey(), in get()
1120 ResponseCode imported = importKey(keyBlob->getValue(), keyBlob->getLength(), filename, in get()
1126 rc = get(filename, keyBlob, TYPE_KEY_PAIR, uid); in get()
1138 ResponseCode put(const char* filename, Blob* keyBlob, uid_t uid) { in put() argument
1140 return keyBlob->writeBlob(filename, userState->getEncryptionKey(), userState->getState(), in put()
1144 ResponseCode del(const char *filename, const BlobType type, uid_t uid) { in del() argument
1146 ResponseCode rc = get(filename, &keyBlob, type, uid); in del()
1163 return (unlink(filename) && errno != ENOENT) ? ::SYSTEM_ERROR : ::NO_ERROR; in del()
1209 void addGrant(const char* filename, uid_t granteeUid) { in addGrant() argument
1210 const grant_t* existing = getGrant(filename, granteeUid); in addGrant()
1214 grant->filename = reinterpret_cast<const uint8_t*>(strdup(filename)); in addGrant()
1219 bool removeGrant(const char* filename, uid_t granteeUid) { in removeGrant() argument
1224 && !strcmp(reinterpret_cast<const char*>(grant->filename), filename)) { in removeGrant()
1232 bool hasGrant(const char* filename, const uid_t uid) const { in hasGrant() argument
1233 return getGrant(filename, uid) != NULL; in hasGrant()
1236 ResponseCode importKey(const uint8_t* key, size_t keyLen, const char* filename, uid_t uid, in importKey() argument
1271 return put(filename, &keyBlob, uid); in importKey()
1386 const grant_t* getGrant(const char* filename, uid_t uid) const { in getGrant() argument
1391 && !strcmp(reinterpret_cast<const char*>(grant->filename), filename)) { in getGrant()
1402 bool upgradeBlob(const char* filename, Blob* blob, const uint8_t oldVersion, in upgradeBlob() argument
1413 importBlobAsKey(blob, filename, uid); in upgradeBlob()
1433 ALOGV("updated and writing file %s", filename); in upgradeBlob()
1446 ResponseCode importBlobAsKey(Blob* blob, const char* filename, uid_t uid) { in importBlobAsKey() argument
1474 ResponseCode rc = importKey(pkcs8key.get(), len, filename, uid, in importBlobAsKey()
1480 return get(filename, blob, TYPE_KEY_PAIR, uid); in importBlobAsKey()
1662 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, targetUid)); in insert() local
1667 return mKeyStore->put(filename.string(), &keyBlob, targetUid); in insert()
1685 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, targetUid)); in del() local
1686 return mKeyStore->del(filename.string(), ::TYPE_GENERIC, targetUid); in del()
1704 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, targetUid)); in exist() local
1706 if (access(filename.string(), R_OK) == -1) { in exist()
1727 String8 filename(mKeyStore->getKeyNameForUid(prefix8, targetUid)); in saw() local
1729 if (mKeyStore->saw(filename, matches, targetUid) != ::NO_ERROR) { in saw()
1968 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, callingUid)); in generate() local
1976 return mKeyStore->put(filename.string(), &keyBlob, callingUid); in generate()
2001 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, targetUid)); in import() local
2003 return mKeyStore->importKey(data, length, filename.string(), targetUid, flags); in import()
2179 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, targetUid)); in del_key() local
2180 return mKeyStore->del(filename.string(), ::TYPE_KEY_PAIR, targetUid); in del_key()
2198 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, callingUid)); in grant() local
2200 if (access(filename.string(), R_OK) == -1) { in grant()
2204 mKeyStore->addGrant(filename.string(), granteeUid); in grant()
2223 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, callingUid)); in ungrant() local
2225 if (access(filename.string(), R_OK) == -1) { in ungrant()
2229 return mKeyStore->removeGrant(filename.string(), granteeUid) ? ::NO_ERROR : ::KEY_NOT_FOUND; in ungrant()
2241 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, callingUid)); in getmtime() local
2243 if (access(filename.string(), R_OK) == -1) { in getmtime()
2244 ALOGW("could not access %s for getmtime", filename.string()); in getmtime()
2248 int fd = TEMP_FAILURE_RETRY(open(filename.string(), O_NOFOLLOW, O_RDONLY)); in getmtime()
2250 ALOGW("could not open %s for getmtime", filename.string()); in getmtime()
2258 ALOGW("could not stat %s for getmtime", filename.string()); in getmtime()
2359 String8 filename(mKeyStore->getKeyNameForUidWithDir(name8, targetUid)); in clear_uid() local
2360 mKeyStore->del(filename.string(), ::TYPE_ANY, targetUid); in clear_uid()