• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:dir

246 bool storeKey(const std::string& dir, const KeyAuthentication& auth, const std::string& key) {  in storeKey()  argument
247 if (TEMP_FAILURE_RETRY(mkdir(dir.c_str(), 0700)) == -1) { in storeKey()
248 PLOG(ERROR) << "key mkdir " << dir; in storeKey()
251 if (!writeStringToFile(kCurrentVersion, dir + "/" + kFn_version)) return false; in storeKey()
258 if (!writeStringToFile(secdiscardable, dir + "/" + kFn_secdiscardable)) return false; in storeKey()
260 if (!writeStringToFile(stretching, dir + "/" + kFn_stretching)) return false; in storeKey()
267 if (!writeStringToFile(salt, dir + "/" + kFn_salt)) return false; in storeKey()
275 if (!writeStringToFile(kmKey, dir + "/" + kFn_keymaster_key_blob)) return false; in storeKey()
278 if (!writeStringToFile(encryptedKey, dir + "/" + kFn_encrypted_key)) return false; in storeKey()
282 bool retrieveKey(const std::string& dir, const KeyAuthentication& auth, std::string* key) { in retrieveKey() argument
284 if (!readFileToString(dir + "/" + kFn_version, &version)) return false; in retrieveKey()
290 if (!readFileToString(dir + "/" + kFn_secdiscardable, &secdiscardable)) return false; in retrieveKey()
292 if (!readFileToString(dir + "/" + kFn_stretching, &stretching)) return false; in retrieveKey()
295 if (!readFileToString(dir + "/" + kFn_salt, &salt)) return false; in retrieveKey()
300 if (!readFileToString(dir + "/" + kFn_keymaster_key_blob, &kmKey)) return false; in retrieveKey()
302 if (!readFileToString(dir + "/" + kFn_encrypted_key, &encryptedMessage)) return false; in retrieveKey()
308 static bool deleteKey(const std::string& dir) { in deleteKey() argument
310 if (!readFileToString(dir + "/" + kFn_keymaster_key_blob, &kmKey)) return false; in deleteKey()
317 static bool secdiscardSecdiscardable(const std::string& dir) { in secdiscardSecdiscardable() argument
319 std::vector<std::string>{kSecdiscardPath, "--", dir + "/" + kFn_secdiscardable}) != 0) { in secdiscardSecdiscardable()
326 static bool recursiveDeleteKey(const std::string& dir) { in recursiveDeleteKey() argument
327 if (ForkExecvp(std::vector<std::string>{kRmPath, "-rf", dir}) != 0) { in recursiveDeleteKey()
334 bool destroyKey(const std::string& dir) { in destroyKey() argument
337 success &= deleteKey(dir); in destroyKey()
338 success &= secdiscardSecdiscardable(dir); in destroyKey()
339 success &= recursiveDeleteKey(dir); in destroyKey()