Lines Matching refs:operation
231 // expect an update to have at least one operation, so the expectation is that
283 LOG(ERROR) << "Failed to perform " << op_type_name << " operation "
284 << next_operation_num_ << ", which is the operation "
675 // Check whether we received all of the next operation's data payload.
679 // Validate the operation only if the metadata signature is present.
692 LOG(ERROR) << "Mandatory operation hash check failed";
697 LOG(WARNING) << "Ignoring operation validation errors";
702 // Makes sure we unblock exit when this operation completes.
740 // In major version 2, we don't add dummy operation to the payload.
879 const chromeos_update_engine::InstallOperation& operation) {
881 if (!operation.has_data_offset() && !operation.has_data_length())
885 if (operation.data_offset() < buffer_offset_) {
890 return (operation.data_offset() + operation.data_length() <=
895 const InstallOperation& operation) {
896 CHECK(operation.type() == InstallOperation::REPLACE ||
897 operation.type() == InstallOperation::REPLACE_BZ ||
898 operation.type() == InstallOperation::REPLACE_XZ);
902 TEST_AND_RETURN_FALSE(buffer_offset_ == operation.data_offset());
903 TEST_AND_RETURN_FALSE(buffer_.size() >= operation.data_length());
905 // Extract the signature message if it's in this operation.
906 if (ExtractSignatureMessageFromOperation(operation)) {
907 // If this is dummy replace operation, we ignore it after extracting the
913 // Setup the ExtentWriter stack based on the operation type.
918 if (operation.type() == InstallOperation::REPLACE_BZ) {
920 } else if (operation.type() == InstallOperation::REPLACE_XZ) {
926 for (int i = 0; i < operation.dst_extents_size(); i++) {
927 extents.push_back(operation.dst_extents(i));
931 TEST_AND_RETURN_FALSE(writer->Write(buffer_.data(), operation.data_length()));
940 const InstallOperation& operation) {
941 CHECK(operation.type() == InstallOperation::DISCARD ||
942 operation.type() == InstallOperation::ZERO);
945 TEST_AND_RETURN_FALSE(!operation.has_data_offset());
946 TEST_AND_RETURN_FALSE(!operation.has_data_length());
951 (operation.type() == InstallOperation::ZERO ? BLKZEROOUT : BLKDISCARD);
958 for (int i = 0; i < operation.dst_extents_size(); i++) {
959 Extent extent = operation.dst_extents(i);
980 bool DeltaPerformer::PerformMoveOperation(const InstallOperation& operation) {
987 for (int i = 0; i < operation.src_extents_size(); i++)
988 blocks_to_read += operation.src_extents(i).num_blocks();
991 for (int i = 0; i < operation.dst_extents_size(); i++)
992 blocks_to_write += operation.dst_extents(i).num_blocks();
999 for (int i = 0; i < operation.src_extents_size(); i++) {
1001 const Extent& extent = operation.src_extents(i);
1016 for (int i = 0; i < operation.dst_extents_size(); i++) {
1017 const Extent& extent = operation.dst_extents(i);
1052 // Compare |calculated_hash| with source hash in |operation|, return false and
1055 const InstallOperation& operation,
1057 brillo::Blob expected_source_hash(operation.src_sha256_hash().begin(),
1058 operation.src_sha256_hash().end());
1060 LOG(ERROR) << "The hash of the source data on disk for this operation "
1073 for (const Extent& ext : operation.src_extents()) {
1077 LOG(ERROR) << "Operation source (offset:size) in blocks: "
1089 const InstallOperation& operation, ErrorCode* error) {
1090 if (operation.has_src_length())
1091 TEST_AND_RETURN_FALSE(operation.src_length() % block_size_ == 0);
1092 if (operation.has_dst_length())
1093 TEST_AND_RETURN_FALSE(operation.dst_length() % block_size_ == 0);
1095 uint64_t blocks_to_read = GetBlockCount(operation.src_extents());
1096 uint64_t blocks_to_write = GetBlockCount(operation.dst_extents());
1102 ExtentsToBlocks(operation.src_extents(), &src_blocks);
1103 ExtentsToBlocks(operation.dst_extents(), &dst_blocks);
1135 if (operation.has_src_sha256_hash())
1139 if (operation.has_src_sha256_hash()) {
1142 ValidateSourceHash(source_hasher.raw_hash(), operation, error));
1171 bool DeltaPerformer::PerformBsdiffOperation(const InstallOperation& operation) {
1174 TEST_AND_RETURN_FALSE(buffer_offset_ == operation.data_offset());
1175 TEST_AND_RETURN_FALSE(buffer_.size() >= operation.data_length());
1178 TEST_AND_RETURN_FALSE(ExtentsToBsdiffPositionsString(operation.src_extents(),
1180 operation.src_length(),
1183 TEST_AND_RETURN_FALSE(ExtentsToBsdiffPositionsString(operation.dst_extents(),
1185 operation.dst_length(),
1197 utils::WriteAll(fd, buffer_.data(), operation.data_length()));
1213 if (operation.dst_length() % block_size_) {
1217 operation.dst_extents(operation.dst_extents_size() - 1);
1221 end_byte - (block_size_ - operation.dst_length() % block_size_);
1230 const InstallOperation& operation, ErrorCode* error) {
1233 TEST_AND_RETURN_FALSE(buffer_offset_ == operation.data_offset());
1234 TEST_AND_RETURN_FALSE(buffer_.size() >= operation.data_length());
1235 if (operation.has_src_length())
1236 TEST_AND_RETURN_FALSE(operation.src_length() % block_size_ == 0);
1237 if (operation.has_dst_length())
1238 TEST_AND_RETURN_FALSE(operation.dst_length() % block_size_ == 0);
1240 if (operation.has_src_sha256_hash()) {
1244 for (const Extent& extent : operation.src_extents()) {
1260 ValidateSourceHash(source_hasher.raw_hash(), operation, error));
1264 operation.src_extents(),
1266 operation.src_length(),
1269 TEST_AND_RETURN_FALSE(ExtentsToBsdiffPositionsString(operation.dst_extents(),
1271 operation.dst_length(),
1283 utils::WriteAll(fd, buffer_.data(), operation.data_length()));
1302 const InstallOperation& operation) {
1303 if (operation.type() != InstallOperation::REPLACE ||
1305 manifest_.signatures_offset() != operation.data_offset()) {
1309 manifest_.signatures_size() == operation.data_length());
1512 const InstallOperation& operation) {
1513 if (!operation.data_sha256_hash().size()) {
1514 if (!operation.data_length()) {
1515 // Operations that do not have any data blob won't have any operation hash
1517 // metadata that contains all the non-data-blob portions of the operation
1522 // No hash is present for an operation that has data blobs. This shouldn't
1524 // corresponding update should have been produced with the operation
1525 // hashes. So if it happens it means either we've turned operation hash
1527 // One caveat though: The last operation is a dummy signature operation
1529 // should not complaint about that operation. This operation can be
1532 manifest_.signatures_offset() == operation.data_offset()) {
1533 LOG(INFO) << "Skipping hash verification for signature operation "
1537 LOG(ERROR) << "Missing mandatory operation hash for operation "
1542 LOG(WARNING) << "Cannot validate operation " << next_operation_num_ + 1
1543 << " as there's no operation hash in manifest";
1549 expected_op_hash.assign(operation.data_sha256_hash().data(),
1550 (operation.data_sha256_hash().data() +
1551 operation.data_sha256_hash().size()));
1554 operation_hasher.Update(buffer_.data(), operation.data_length());
1556 LOG(ERROR) << "Unable to compute actual hash of operation "
1563 LOG(ERROR) << "Hash verification failed for operation "
1566 LOG(ERROR) << "Calculated hash over " << operation.data_length()
1567 << " bytes at offset: " << operation.data_offset() << " = ";