Home | History | Annotate | Download | only in keystore

Lines Matching refs:UserState

622 class UserState {
624 UserState(uid_t userId) : mUserId(userId), mRetry(MAX_RETRY) {
629 ~UserState() {
886 for (android::Vector<UserState*>::iterator it(mMasterKeys.begin());
911 UserState* userState = getUserState(uid);
912 return userState->initialize(pw, mEntropy);
917 UserState* userState = getUserState(user_id);
918 return userState->writeMasterKey(pw, mEntropy);
923 UserState* userState = getUserState(user_id);
924 return userState->readMasterKey(pw, mEntropy);
947 UserState* userState = getUserState(uid);
948 userState->zeroizeMasterKeysInMemory();
949 userState->setState(STATE_UNINITIALIZED);
950 return userState->reset();
954 const UserState* userState = getUserState(uid);
955 if (userState == NULL) {
959 DIR* dir = opendir(userState->getUserDirName());
990 UserState* userState = getUserState(uid);
991 userState->zeroizeMasterKeysInMemory();
992 userState->setState(STATE_LOCKED);
996 UserState* userState = getUserState(uid);
997 ResponseCode rc = keyBlob->readBlob(filename, userState->getDecryptionKey(),
998 userState->getState());
1011 || (rc = keyBlob->readBlob(filename, userState->getDecryptionKey(),
1012 userState->getState())) != NO_ERROR) {
1044 UserState* userState = getUserState(uid);
1045 return keyBlob->writeBlob(filename, userState->getEncryptionKey(), userState->getState(),
1163 * Returns any existing UserState or creates it if it doesn't exist.
1165 UserState* getUserState(uid_t uid) {
1168 for (android::Vector<UserState*>::iterator it(mMasterKeys.begin());
1170 UserState* state = *it;
1176 UserState* userState = new UserState(userId);
1177 if (!userState->initialize()) {
1184 mMasterKeys.add(userState);
1185 return userState;
1189 * Returns NULL if the UserState doesn't already exist.
1191 const UserState* getUserState(uid_t uid) const {
1194 for (android::Vector<UserState*>::const_iterator it(mMasterKeys.begin());
1196 UserState* state = *it;
1213 android::Vector<UserState*> mMasterKeys;
1354 UserState* userState = getUserState(0);
1357 userState->initialize();
1361 if (rename(sOldMasterKey, userState->getMasterKeyFileName()) < 0) {
1368 userState->initialize();
1396 UserState* otherUser = getUserState(thisUid);
1564 UserState* userState = mKeyStore->getUserState(targetUid);
1565 DIR* dir = opendir(userState->getUserDirName());
2249 UserState* userState = mKeyStore->getUserState(callingUid);
2250 DIR* dir = opendir(userState->getUserDirName());
2277 String8 filename(String8::format("%s/%s", userState->getUserDirName(), file->d_name));