/bootable/recovery/tests/component/ |
D | imgdiff_test.cpp | 39 const size_t size = patch.size(); in verify_patch_header() local 42 ASSERT_GE(size, 12U); in verify_patch_header() 54 ASSERT_LE(pos + 4, size); in verify_patch_header() 59 ASSERT_LE(pos, size); in verify_patch_header() 62 ASSERT_LE(pos + 4, size); in verify_patch_header() 66 ASSERT_LE(pos, size); in verify_patch_header() 70 ASSERT_LE(pos, size); in verify_patch_header() 112 ASSERT_EQ(0, imgdiff(args.size(), args.data())); in TEST() 128 ASSERT_EQ(0, ApplyImagePatch(reinterpret_cast<const unsigned char*>(src.data()), src.size(), in TEST() 129 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(), in TEST() [all …]
|
D | applypatch_test.cpp | 47 *fsize = data.size(); in sha1sum() 51 SHA1(reinterpret_cast<const uint8_t*>(data.c_str()), data.size(), digest); in sha1sum() 298 size_t size; in TEST() local 300 sha1sum(recovery_img, &recovery_img_sha1, &size); in TEST() 301 std::string recovery_img_size = std::to_string(size); in TEST() 321 ASSERT_EQ(0, applypatch_modes(args.size(), args.data())); in TEST() 335 ASSERT_EQ(0, applypatch_modes(args2.size(), args2.data())); in TEST() 358 ASSERT_EQ(0, applypatch_modes(args3.size(), args3.data())); in TEST() 375 size_t size; in TEST() local 377 sha1sum(recovery_img, &recovery_img_sha1, &size); in TEST() [all …]
|
D | install_test.cpp | 74 ASSERT_EQ(0, compatibility_zip_writer.WriteBytes(malformed_xml.data(), malformed_xml.size())); in TEST() 87 writer.WriteBytes(compatibility_zip_content.data(), compatibility_zip_content.size())); in TEST() 119 system_manifest_xml_content.size())); in TEST() 132 writer.WriteBytes(compatibility_zip_content.data(), compatibility_zip_content.size())); in TEST() 158 ASSERT_EQ(0, writer.WriteBytes(properties.data(), properties.size())); in TEST() 171 ASSERT_EQ(0, writer.WriteBytes(metadata.data(), metadata.size())); in TEST() 212 ASSERT_EQ(0, writer.WriteBytes(metadata.data(), metadata.size())); in TEST()
|
D | uncrypt_test.cpp | 104 int length = static_cast<int>(message.size()); in TEST_F() 133 ASSERT_LE(message_in_bcb.size(), sizeof(boot.recovery)); in TEST_F() 134 size_t left = sizeof(boot.recovery) - message_in_bcb.size(); in TEST_F() 135 ASSERT_EQ(std::string(left, '\0'), std::string(&boot.recovery[message_in_bcb.size()], left)); in TEST_F()
|
D | updater_test.cpp | 76 SHA1(reinterpret_cast<const uint8_t*>(content.c_str()), content.size(), digest); in get_sha1() 140 size_t src_size = src_content.size(); in TEST_F() 487 ASSERT_EQ(2U, android::base::Split(cmd, " ").size()); in TEST_F() 511 ASSERT_EQ(3U, android::base::Split(cmd, " ").size()); in TEST_F() 529 src_content.size(), reinterpret_cast<const uint8_t*>(tgt_content.data()), 530 tgt_content.size(), patch_file.path, nullptr)); 534 ASSERT_EQ(0, zip_writer.WriteBytes(patch_content.data(), patch_content.size())); 546 android::base::StringPrintf("bsdiff 0 %zu %s %s 2,0,2 2 - %s:2,0,2", patch_content.size(), 552 ASSERT_EQ(0, zip_writer.WriteBytes(commands.data(), commands.size())); 567 ASSERT_EQ(0, zip_writer.WriteBytes(fail_commands.data(), fail_commands.size()));
|
/bootable/recovery/updater/ |
D | install.cpp | 107 while (prev_end < name.size()) { in make_parents() 132 if (argv.size() != 4 && argv.size() != 5) { in MountFn() 134 argv.size()); in MountFn() 147 if (argv.size() == 5) { in MountFn() 194 if (argv.size() != 1) { in IsMountedFn() 195 return ErrorAbort(state, kArgsParsingFailure, "%s() expects 1 arg, got %zu", name, argv.size()); in IsMountedFn() 218 if (argv.size() != 1) { in UnmountFn() 219 return ErrorAbort(state, kArgsParsingFailure, "%s() expects 1 arg, got %zu", name, argv.size()); in UnmountFn() 269 if (argv.size() != 5) { in FormatFn() 271 argv.size()); in FormatFn() [all …]
|
D | blockimg.cpp | 69 size_t size; member 74 if (idx >= size) { in get_block() 75 LOG(ERROR) << "index: " << idx << " is greater than range set size: " << size; in get_block() 78 for (size_t i = 0; i < pos.size(); i += 2) { in get_block() 96 if (pieces.size() < 3) { in parse_range() 107 } else if (num != pieces.size() - 1) { in parse_range() 113 rs.size = 0; in parse_range() 129 if (rs.size > SIZE_MAX - sz) { in parse_range() 133 rs.size += sz; in parse_range() 161 static int read_all(int fd, uint8_t* data, size_t size) { in read_all() argument [all …]
|
/bootable/recovery/applypatch/ |
D | imgpatch.cpp | 62 if (patch->data.size() < 12) { in ApplyImagePatch() 81 if (pos + 4 > patch->data.size()) { in ApplyImagePatch() 91 if (pos > patch->data.size()) { in ApplyImagePatch() 108 if (pos > patch->data.size()) { in ApplyImagePatch() 115 if (pos + data_len > patch->data.size()) { in ApplyImagePatch() 130 if (pos > patch->data.size()) { in ApplyImagePatch() 158 size_t bonus_size = (i == 1 && bonus_data != NULL) ? bonus_data->data.size() : 0; in ApplyImagePatch() 210 if (uncompressed_target_data.size() != target_len) { in ApplyImagePatch() 212 uncompressed_target_data.size()); in ApplyImagePatch() 220 if (expanded_source.size() < 32768U) { in ApplyImagePatch() [all …]
|
D | imgdiff.cpp | 258 CHECK_LE(start_ + raw_data_len_, input_file_ptr_->size()); in GetRawData() 271 return uncompressed_data_.size(); in DataLengthForPatch() 290 source_uncompressed_len_ = src.uncompressed_data_.size(); in SetSourceInfo() 352 printf("normal (%10zu, %10zu) %10zu\n", start_, raw_data_len_, patch.size()); in WriteHeaderToFd() 356 return offset + patch.size(); in WriteHeaderToFd() 358 printf("deflate (%10zu, %10zu) %10zu %s\n", start_, raw_data_len_, patch.size(), in WriteHeaderToFd() 364 Write8(fd, static_cast<int64_t>(uncompressed_data_.size())); in WriteHeaderToFd() 370 return offset + patch.size(); in WriteHeaderToFd() 373 Write4(fd, static_cast<int32_t>(patch.size())); in WriteHeaderToFd() 374 if (!android::base::WriteFully(fd, patch.data(), patch.size())) { in WriteHeaderToFd() [all …]
|
D | applypatch.cpp | 70 size_t bytes_read = ota_fread(data.data(), 1, data.size(), f.get()); in LoadFileContents() 71 if (bytes_read != data.size()) { in LoadFileContents() 72 printf("short read of \"%s\" (%zu bytes of %zu)\n", filename, bytes_read, data.size()); in LoadFileContents() 76 SHA1(file->data.data(), file->data.size(), file->sha1); in LoadFileContents() 96 if (pieces.size() < 4 || pieces.size() % 2 != 0 || pieces[0] != "EMMC") { in LoadPartitionContents() 101 size_t pair_count = (pieces.size() - 2) / 2; // # of (size, sha1) pairs in filename in LoadPartitionContents() 104 size_t size; in LoadPartitionContents() local 105 if (!android::base::ParseUint(pieces[i * 2 + 2], &size) || size == 0) { in LoadPartitionContents() 109 pairs.push_back({ size, pieces[i * 2 + 3] }); in LoadPartitionContents() 197 ssize_t bytes_written = FileSink(file->data.data(), file->data.size(), &fd); in SaveFileContents() [all …]
|
D | bspatch.cpp | 72 patch->data.size(), sha_sink); in ApplyBSDiffPatch() 83 patch->data.size(), vector_sink); in ApplyBSDiffPatchMem()
|
D | imgdiff_test.sh | 60 size() { function 94 /data/local/tmp/target $(sha1 $tmpdir/target) $(size $tmpdir/target) \
|
/bootable/recovery/otautil/ |
D | SysUtil.cpp | 78 if (lines.size() < 4) { in sysMapBlockFile() 79 LOG(ERROR) << "Block map file is too short: " << lines.size(); in sysMapBlockFile() 83 size_t size; in sysMapBlockFile() local 85 if (sscanf(lines[1].c_str(), "%zu %u", &size, &blksize) != 2) { in sysMapBlockFile() 98 blocks = ((size - 1) / blksize) + 1; in sysMapBlockFile() 100 if (size == 0 || blksize == 0 || blocks > SIZE_MAX / blksize || range_count == 0 || in sysMapBlockFile() 101 lines.size() != 3 + range_count) { in sysMapBlockFile() 102 LOG(ERROR) << "Invalid data in block map file: size " << size << ", blksize " << blksize in sysMapBlockFile() 103 << ", range_count " << range_count << ", lines " << lines.size(); in sysMapBlockFile() 166 pMap->length = size; in sysMapBlockFile()
|
D | ZipUtil.cpp | 71 CHECK_LE(prefix_path.size(), entry_name.size()); in ExtractPackageRecursive() 72 std::string path = target_dir + entry_name.substr(prefix_path.size()); in ExtractPackageRecursive()
|
/bootable/recovery/tests/unit/ |
D | sysutil_test.cpp | 43 ASSERT_EQ(content.size(), mapping.length); in TEST() 44 ASSERT_EQ(1U, mapping.ranges.size()); in TEST() 47 ASSERT_EQ(0U, mapping.ranges.size()); in TEST() 68 ASSERT_EQ(1U, mapping.ranges.size()); in TEST() 76 ASSERT_EQ(1U, mapping.ranges.size()); in TEST() 84 ASSERT_EQ(1U, mapping.ranges.size()); in TEST() 92 ASSERT_EQ(3U, mapping.ranges.size()); in TEST() 95 ASSERT_EQ(0U, mapping.ranges.size()); in TEST() 139 ASSERT_EQ(0U, mapping.ranges.size()); in TEST()
|
/bootable/recovery/update_verifier/ |
D | update_verifier.cpp | 131 (range_count != ranges.size() - 1)) { in read_blocks() 137 for (size_t i = 1; i < ranges.size(); i += 2) { in read_blocks() 151 size_t size = (range_end - range_start) * BLOCKSIZE; in read_blocks() local 152 std::vector<uint8_t> buf(size); in read_blocks() 153 if (!android::base::ReadFully(fd.get(), buf.data(), size)) { in read_blocks() 185 if (lines.size() != 2 && lines.size() != 4) { in verify_image() 186 LOG(ERROR) << "Invalid lines in care_map: found " << lines.size() in verify_image() 191 for (size_t i = 0; i < lines.size(); i += 2) { in verify_image()
|
/bootable/recovery/bootloader_message/ |
D | bootloader_message.cpp | 70 static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, in read_misc_partition() argument 86 if (!android::base::ReadFully(fd, p, size)) { in read_misc_partition() 94 static bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device, in write_misc_partition() argument 107 if (!android::base::WriteFully(fd, p, size)) { in write_misc_partition() 200 bool read_wipe_package(std::string* package_data, size_t size, std::string* err) { in read_wipe_package() argument 205 package_data->resize(size); in read_wipe_package() 206 return read_misc_partition(&(*package_data)[0], size, misc_blk_device, in read_wipe_package() 215 return write_misc_partition(package_data.data(), package_data.size(), misc_blk_device, in write_wipe_package()
|
/bootable/recovery/ |
D | mounts.cpp | 40 for (size_t i = 0; i < g_mounts_state.size(); ++i) { in scan_mounted_volumes() 64 for (size_t i = 0; i < g_mounts_state.size(); ++i) { in find_mounted_volume_by_device() 71 for (size_t i = 0; i < g_mounts_state.size(); ++i) { in find_mounted_volume_by_mount_point()
|
D | fuse_sideload.cpp | 161 uint64_t nodeid, uint64_t size, uint32_t mode) { in fill_attr() argument 169 attr->size = size; in fill_attr() 170 attr->blocks = (size == 0) ? 0 : (((size-1) / attr->blksize) + 1); in fill_attr() 302 uint32_t size = req->size; in handle_read() local 315 outhdr.len = sizeof(outhdr) + size; in handle_read() 338 if (size + block_offset <= fd->block_size) { in handle_read() 342 vec[1].iov_len = size; in handle_read() 355 vec[2].iov_len = size - vec[1].iov_len; in handle_read()
|
D | verifier.cpp | 220 size_t size = std::min(signed_len - so_far, 16 * MiB); in verify_file() local 222 if (need_sha1) SHA1_Update(&sha1_ctx, addr + so_far, size); in verify_file() 223 if (need_sha256) SHA256_Update(&sha256_ctx, addr + so_far, size); in verify_file() 224 so_far += size; in verify_file() 228 if (f > frac + 0.02 || size == so_far) { in verify_file() 274 if (!RSA_verify(hash_nid, hash, key.hash_len, sig_der.data(), sig_der.size(), in verify_file() 283 if (!ECDSA_verify(0, hash, key.hash_len, sig_der.data(), sig_der.size(), key.ec.get())) { in verify_file()
|
D | interlace-frames.py | 41 sizes.add(fr.size) 81 width, height = img.size
|
/bootable/recovery/edify/ |
D | expr.cpp | 81 for (size_t i = 0; i < argv.size(); ++i) { in ConcatFn() 93 if (argv.size() != 2 && argv.size() != 3) { in IfElseFn() 105 } else if (argv.size() == 3) { in IfElseFn() 123 for (size_t i = 0; i < argv.size(); ++i) { in AssertFn() 153 for (size_t i = 0; i < argv.size(); ++i) { in StdoutFn() 254 if (argv.size() != 2) { in LessThanIntFn() 282 if (argv.size() != 2) { in GreaterThanIntFn() 352 return ReadArgs(state, argv, args, 0, argv.size()); in ReadArgs() 360 if (start + len > argv.size()) { in ReadArgs() 378 return ReadValueArgs(state, argv, args, 0, argv.size()); in ReadValueArgs() [all …]
|
/bootable/recovery/otafault/ |
D | ota_io.h | 43 size_t ota_fread(void* ptr, size_t size, size_t nitems, FILE* stream); 47 size_t ota_fwrite(const void* ptr, size_t size, size_t count, FILE* stream);
|
D | ota_io.cpp | 100 size_t ota_fread(void* ptr, size_t size, size_t nitems, FILE* stream) { in ota_fread() argument 112 size_t status = fread(ptr, size, nitems, stream); in ota_fread() 139 size_t ota_fwrite(const void* ptr, size_t size, size_t count, FILE* stream) { in ota_fwrite() argument 151 size_t status = fwrite(ptr, size, count, stream); in ota_fwrite()
|
/bootable/recovery/tests/manual/ |
D | recovery_test.cpp | 49 EXPECT_EQ(myContent.size(), len); in __pmsg_fn() 63 myFilename.c_str(), myContent.c_str(), myContent.size())); in TEST() 68 EXPECT_EQ(static_cast<ssize_t>(myContent.size()), ret); in TEST() 80 myFilename.c_str(), myContent.c_str(), myContent.size())); in TEST()
|