Lines Matching refs:hashtree_file
62 const std::string& hashtree_file) { in GenerateHashTree() argument
114 hashtree_file.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0600))); in GenerateHashTree()
116 return Error() << "Failed to write hashtree to " << hashtree_file; in GenerateHashTree()
121 Result<std::string> CalculateRootDigest(const std::string& hashtree_file, in CalculateRootDigest() argument
124 TEMP_FAILURE_RETRY(open(hashtree_file.c_str(), O_RDONLY | O_CLOEXEC))); in CalculateRootDigest()
126 return ErrnoError() << "Failed to open " << hashtree_file; in CalculateRootDigest()
133 << hashtree_file; in CalculateRootDigest()
146 return Error() << "Failed to calculate digest of " << hashtree_file; in CalculateRootDigest()
157 const std::string& hashtree_file) { in PrepareHashTree() argument
162 if (auto st = CreateDirIfNeeded(Dirname(hashtree_file), 0700); !st.ok()) { in PrepareHashTree()
166 auto exists = PathExists(hashtree_file); in PrepareHashTree()
171 auto digest = CalculateRootDigest(hashtree_file, verity_data); in PrepareHashTree()
176 LOG(ERROR) << "Regenerating hashtree! Digest of " << hashtree_file in PrepareHashTree()
187 if (auto st = GenerateHashTree(apex, verity_data, hashtree_file); in PrepareHashTree()
191 LOG(INFO) << "hashtree: generated to " << hashtree_file; in PrepareHashTree()
194 LOG(INFO) << "hashtree: reuse " << hashtree_file; in PrepareHashTree()