Lines Matching refs:policy
219 static bool buildKeySpecifier(fscrypt_key_specifier* spec, const EncryptionPolicy& policy) { in buildKeySpecifier() argument
220 switch (policy.options.version) { in buildKeySpecifier()
222 if (policy.key_raw_ref.size() != FSCRYPT_KEY_DESCRIPTOR_SIZE) { in buildKeySpecifier()
224 << policy.key_raw_ref.size(); in buildKeySpecifier()
228 memcpy(spec->u.descriptor, policy.key_raw_ref.c_str(), FSCRYPT_KEY_DESCRIPTOR_SIZE); in buildKeySpecifier()
231 if (policy.key_raw_ref.size() != FSCRYPT_KEY_IDENTIFIER_SIZE) { in buildKeySpecifier()
233 << policy.key_raw_ref.size(); in buildKeySpecifier()
237 memcpy(spec->u.identifier, policy.key_raw_ref.c_str(), FSCRYPT_KEY_IDENTIFIER_SIZE); in buildKeySpecifier()
240 LOG(ERROR) << "Invalid encryption policy version: " << policy.options.version; in buildKeySpecifier()
274 const KeyBuffer& key, EncryptionPolicy* policy) { in installKey() argument
276 policy->options = options; in installKey()
288 policy->key_raw_ref = generateKeyRef((const uint8_t*)key.data(), key.size()); in installKey()
290 return installKeyLegacy(key, policy->key_raw_ref); in installKey()
292 if (!buildKeySpecifier(&arg->key_spec, *policy)) { in installKey()
316 policy->key_raw_ref = in installKey()
319 std::string ref = keyrefstring(policy->key_raw_ref); in installKey()
427 bool evictKey(const std::string& mountpoint, const EncryptionPolicy& policy) { in evictKey() argument
429 if (policy.options.version == 1 && !isFsKeyringSupported()) { in evictKey()
430 return evictKeyLegacy(policy.key_raw_ref); in evictKey()
442 if (!buildKeySpecifier(&arg.key_spec, policy)) { in evictKey()
446 std::string ref = keyrefstring(policy.key_raw_ref); in evictKey()
490 bool reloadKeyFromSessionKeyring(const std::string& mountpoint, const EncryptionPolicy& policy) { in reloadKeyFromSessionKeyring() argument
496 std::string ref = keyrefstring(policy.key_raw_ref); in reloadKeyFromSessionKeyring()
509 if (!buildKeySpecifier(&arg.key_spec, policy)) return false; in reloadKeyFromSessionKeyring()
511 if (!installFsKeyringKey(mountpoint, policy.options, &arg)) return false; in reloadKeyFromSessionKeyring()