Home
last modified time | relevance | path

Searched refs:blob (Results 1 – 25 of 100) sorted by relevance

1234

/system/nvram/core/
Dpersistence.cpp46 storage::Status EncodeObject(const Object& object, Blob* blob) { in EncodeObject() argument
47 BlobOutputStreamBuffer stream(blob); in EncodeObject()
67 storage::Status DecodeObject(const Blob& blob, Object* object) { in DecodeObject() argument
68 InputStreamBuffer stream(blob.data(), blob.size()); in DecodeObject()
73 NVRAM_LOG_ERR("Failed to decode object of size %zu.", blob.size()); in DecodeObject()
100 Blob blob; in LoadHeader() local
101 storage::Status status = storage::LoadHeader(&blob); in LoadHeader()
105 return DecodeObject<kHeaderMagic>(blob, header); in LoadHeader()
109 Blob blob; in StoreHeader() local
110 storage::Status status = EncodeObject<kHeaderMagic>(header, &blob); in StoreHeader()
[all …]
/system/nvram/hal/
Dmemory_storage.cpp30 Status Load(Blob* blob) const { in Load()
35 if (!blob->Assign(blob_.data(), blob_.size())) { in Load()
42 Status Store(const Blob& blob) { in Store() argument
43 if (!blob_.Assign(blob.data(), blob.size())) { in Store()
81 Status LoadHeader(Blob* blob) { in LoadHeader() argument
82 return g_header.Load(blob); in LoadHeader()
85 Status StoreHeader(const Blob& blob) { in StoreHeader() argument
86 return g_header.Store(blob); in StoreHeader()
89 Status LoadSpace(uint32_t index, Blob* blob) { in LoadSpace() argument
91 return slot ? slot->Load(blob) : Status::kNotFound; in LoadSpace()
[all …]
Dfake_nvram_storage.cpp78 nvram::storage::Status LoadFile(const char* name, nvram::Blob* blob) { in LoadFile() argument
100 if (!blob->Resize(data_file_stat.st_size)) { in LoadFile()
105 if (!android::base::ReadFully(data_file_fd.get(), blob->data(), in LoadFile()
106 blob->size())) { in LoadFile()
115 nvram::storage::Status StoreFile(const char* name, const nvram::Blob& blob) { in StoreFile() argument
127 if (!android::base::WriteFully(data_file_fd.get(), blob.data(), in StoreFile()
128 blob.size())) { in StoreFile()
170 Status LoadHeader(Blob* blob) { in LoadHeader() argument
171 return LoadFile(kHeaderFileName, blob); in LoadHeader()
174 Status StoreHeader(const Blob& blob) { in StoreHeader() argument
[all …]
/system/update_engine/payload_consumer/
Dextent_reader_unittest.cc64 void ReadExtents(vector<Extent> extents, brillo::Blob* blob) { in ReadExtents() argument
65 blob->clear(); in ReadExtents()
67 blob->insert( in ReadExtents()
68 blob->end(), in ReadExtents()
96 brillo::Blob blob(1); in TEST_F() local
97 EXPECT_TRUE(reader.Read(blob.data(), 0)); in TEST_F()
98 EXPECT_FALSE(reader.Read(blob.data(), 1)); in TEST_F()
105 brillo::Blob blob(1); in TEST_F() local
106 EXPECT_TRUE(reader.Read(blob.data(), 0)); in TEST_F()
107 EXPECT_FALSE(reader.Read(blob.data(), 1)); in TEST_F()
[all …]
/system/nvram/core/tests/
Dfake_storage.cpp31 Status Load(Blob* blob) { in Load() argument
40 NVRAM_CHECK(blob->Assign(blob_.data(), blob_.size())); in Load()
44 Status Store(const Blob& blob) { in Store() argument
49 NVRAM_CHECK(blob_.Assign(blob.data(), blob.size())); in Store()
127 Status LoadHeader(Blob* blob) { in LoadHeader() argument
128 return g_header.Load(blob); in LoadHeader()
131 Status StoreHeader(const Blob& blob) { in StoreHeader() argument
132 return g_header.Store(blob); in StoreHeader()
143 Status LoadSpace(uint32_t index, Blob* blob) { in LoadSpace() argument
145 return slot ? slot->Load(blob) : Status::kNotFound; in LoadSpace()
[all …]
/system/core/fs_mgr/liblp/
Dwriter.cpp38 std::string blob(reinterpret_cast<const char*>(&geometry), sizeof(geometry)); in SerializeGeometry()
39 blob.resize(LP_METADATA_GEOMETRY_SIZE); in SerializeGeometry()
40 return blob; in SerializeGeometry()
86 const std::string& slot_suffix, std::string* blob) { in ValidateAndSerializeMetadata() argument
89 *blob = SerializeMetadata(metadata); in ValidateAndSerializeMetadata()
92 if (blob->size() > geometry.metadata_max_size) { in ValidateAndSerializeMetadata()
93 LERROR << "Logical partition metadata is too large. " << blob->size() << " > " in ValidateAndSerializeMetadata()
181 const std::string& blob, in WritePrimaryMetadata() argument
184 if (!ValidateMetadataRegion(metadata, primary_offset, blob.size())) { in WritePrimaryMetadata()
191 if (!writer(fd, blob)) { in WritePrimaryMetadata()
[all …]
/system/keymaster/legacy_support/
Dkeymaster_passthrough_engine.cpp95 const KeymasterKeyBlob& blob, in ExportKey() argument
100 keymaster_error_t error = km_device_->export_key(km_device_, format, &blob, &client_id, in ExportKey()
111 keymaster_error_t DeleteKey(const KeymasterKeyBlob& blob) const override { in DeleteKey()
112 return km_device_->delete_key(km_device_, &blob); in DeleteKey()
219 keymaster_key_blob_t blob = {}; in GenerateKey() local
221 &blob, &characteristics); in GenerateKey()
224 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in GenerateKey()
225 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey()
226 key_blob->key_material_size = blob.key_material_size; in GenerateKey()
242 keymaster_key_blob_t blob = {}; in GenerateKey() local
[all …]
Dkeymaster0_engine.cpp132 bool Keymaster0Engine::DeleteKey(const KeymasterKeyBlob& blob) const { in DeleteKey()
135 return (keymaster0_device_->delete_keypair(keymaster0_device_, blob.key_material, in DeleteKey()
136 blob.key_material_size) == 0); in DeleteKey()
158 inline keymaster_key_blob_t* duplicate_blob(const keymaster_key_blob_t& blob) { in duplicate_blob() argument
159 return duplicate_blob(blob.key_material, blob.key_material_size); in duplicate_blob()
162 RSA* Keymaster0Engine::BlobToRsaKey(const KeymasterKeyBlob& blob) const { in BlobToRsaKey()
168 keymaster_key_blob_t* blob_copy = duplicate_blob(blob); in BlobToRsaKey()
173 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(GetKeymaster0PublicKey(blob)); in BlobToRsaKey()
187 EC_KEY* Keymaster0Engine::BlobToEcKey(const KeymasterKeyBlob& blob) const { in BlobToEcKey()
193 keymaster_key_blob_t* blob_copy = duplicate_blob(blob); in BlobToEcKey()
[all …]
Dkeymaster1_engine.cpp85 keymaster_key_blob_t blob; in GenerateKey() local
87 &blob, &characteristics); in GenerateKey()
90 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in GenerateKey()
91 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey()
92 key_blob->key_material_size = blob.key_material_size; in GenerateKey()
109 keymaster_key_blob_t blob; in ImportKey() local
112 &blob, &characteristics); in ImportKey()
115 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in ImportKey()
116 output_key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in ImportKey()
117 output_key_blob->key_material_size = blob.key_material_size; in ImportKey()
[all …]
/system/keymaster/include/keymaster/
Dandroid_keymaster_utils.h241 const uint8_t* const & accessBlobData(const keymaster_key_blob_t* blob) { in accessBlobData() argument
242 return blob->key_material; in accessBlobData()
245 const uint8_t*& accessBlobData(keymaster_key_blob_t* blob) { in accessBlobData() argument
246 return blob->key_material; in accessBlobData()
249 const size_t& accessBlobSize(const keymaster_key_blob_t* blob) { in accessBlobSize() argument
250 return blob->key_material_size; in accessBlobSize()
253 size_t& accessBlobSize(keymaster_key_blob_t* blob) { in accessBlobSize() argument
254 return blob->key_material_size; in accessBlobSize()
258 const uint8_t* const & accessBlobData(const keymaster_blob_t* blob) { in accessBlobData() argument
259 return blob->data; in accessBlobData()
[all …]
/system/update_engine/payload_generator/
Dblob_file_writer_unittest.cc42 brillo::Blob blob(blob_size); in TEST() local
43 FillWithData(&blob); in TEST()
44 EXPECT_EQ(0, blob_file.StoreBlob(blob)); in TEST()
45 EXPECT_EQ(blob_size, blob_file.StoreBlob(blob)); in TEST()
52 EXPECT_EQ(blob, stored_blob); in TEST()
Dblock_mapping.cc35 size_t HashValue(const brillo::Blob& blob) { in HashValue() argument
37 return hash_fn(string(blob.begin(), blob.end())); in HashValue()
49 brillo::Blob blob(block_size_); in AddDiskBlock() local
51 if (!utils::PReadAll(fd, blob.data(), block_size_, byte_offset, &bytes_read)) in AddDiskBlock()
55 return AddBlock(fd, byte_offset, blob); in AddDiskBlock()
121 brillo::Blob blob(block_size); in CompareData() local
123 if (!utils::PReadAll(fd, blob.data(), block_size, byte_offset, &bytes_read)) in CompareData()
127 *equals = blob == other_block; in CompareData()
136 block_data = std::move(blob); in CompareData()
Dblob_file_writer.cc23 off_t BlobFileWriter::StoreBlob(const brillo::Blob& blob) { in StoreBlob() argument
25 if (!utils::PWriteAll(blob_fd_, blob.data(), blob.size(), *blob_file_size_)) in StoreBlob()
29 *blob_file_size_ += blob.size(); in StoreBlob()
Dannotated_operation.cc39 bool AnnotatedOperation::SetOperationBlob(const brillo::Blob& blob, in SetOperationBlob() argument
41 if (blob.empty()) { in SetOperationBlob()
46 off_t data_offset = blob_file->StoreBlob(blob); in SetOperationBlob()
49 op.set_data_length(blob.size()); in SetOperationBlob()
Dblock_mapping_unittest.cc47 brillo::Blob blob(block_size_); in TEST_F() local
50 blob[0] = 42; in TEST_F()
51 EXPECT_EQ(0, bm_.AddBlock(blob)); in TEST_F()
52 blob[0] = 5; in TEST_F()
53 EXPECT_EQ(1, bm_.AddBlock(blob)); in TEST_F()
Dsquashfs_filesystem.cc52 bool ReadSquashfsHeader(const brillo::Blob blob, in ReadSquashfsHeader() argument
54 if (blob.size() < kSquashfsSuperBlockSize) { in ReadSquashfsHeader()
58 memcpy(&header->magic, blob.data(), 4); in ReadSquashfsHeader()
59 memcpy(&header->block_size, blob.data() + 12, 4); in ReadSquashfsHeader()
60 memcpy(&header->compression_type, blob.data() + 20, 2); in ReadSquashfsHeader()
61 memcpy(&header->major_version, blob.data() + 28, 2); in ReadSquashfsHeader()
257 brillo::Blob blob(kSquashfsSuperBlockSize); in CreateFromFile() local
258 if (!sqfs_file->ReadAllBlocking(blob.data(), blob.size(), nullptr)) { in CreateFromFile()
262 if (!ReadSquashfsHeader(blob, &header) || !CheckHeader(header)) { in CreateFromFile()
319 bool SquashfsFilesystem::IsSquashfsImage(const brillo::Blob& blob) { in IsSquashfsImage() argument
[all …]
/system/nvram/core/include/nvram/core/
Dstorage.h38 Status LoadHeader(Blob* blob);
42 Status StoreHeader(const Blob& blob);
55 Status LoadSpace(uint32_t index, Blob* blob);
74 Status StoreSpace(uint32_t index, const Blob& blob);
/system/keymaster/contexts/
Dsoft_keymaster_context.cpp199 KeymasterKeyBlob* blob, in CreateKeyBlob() argument
212 return SerializeIntegrityAssuredBlob(key_material, hidden, *hw_enforced, *sw_enforced, blob); in CreateKeyBlob()
243 keymaster_error_t SoftKeymasterContext::ParseKeyBlob(const KeymasterKeyBlob& blob, in ParseKeyBlob() argument
303 … error = DeserializeIntegrityAssuredBlob(blob, hidden, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
308 error = ParseOcbAuthEncryptedBlob(blob, hidden, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
315 error = ParseOldSoftkeymasterBlob(blob, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
322 error = ParseKeymaster1HwBlob(blob, additional_params, &key_material, &hw_enforced, in ParseKeyBlob()
325 error = ParseKeymaster0HwBlob(blob, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
332 keymaster_error_t SoftKeymasterContext::DeleteKey(const KeymasterKeyBlob& blob) const { in DeleteKey()
340 blob, &key_material, &hw_enforced, &sw_enforced); in DeleteKey()
[all …]
Dkeymaster1_passthrough_context.cpp111 const KeymasterKeyBlob& blob, in parseKeymaster1HwBlob() argument
127 keymaster_error_t error = device->get_key_characteristics(device, &blob, client_id_ptr, in parseKeymaster1HwBlob()
137 *key_material = blob; in parseKeymaster1HwBlob()
141 keymaster_error_t Keymaster1PassthroughContext::ParseKeyBlob(const KeymasterKeyBlob& blob, in ParseKeyBlob() argument
154 … error = DeserializeIntegrityAssuredBlob(blob, hidden, &key_material, &hw_enforced, &sw_enforced); in ParseKeyBlob()
159 error = parseKeymaster1HwBlob(km1_engine_->device(), blob, additional_params, in ParseKeyBlob()
176 keymaster_error_t Keymaster1PassthroughContext::DeleteKey(const KeymasterKeyBlob& blob) const { in DeleteKey()
184 blob, &key_material, &hw_enforced, &sw_enforced); in DeleteKey()
189 error = km1_engine_->DeleteKey(blob); in DeleteKey()
216 KeymasterKeyBlob* blob, in CreateKeyBlob() argument
[all …]
/system/security/keystore/
Dlegacy_keymaster_device_wrapper.cpp99 keymaster_param_blob(tag, &keyParams[i].blob[0], keyParams[i].blob.size()); in KmParamSet()
122 inline static keymaster_blob_t hidlVec2KmBlob(const hidl_vec<uint8_t>& blob) { in hidlVec2KmBlob() argument
124 if (blob.size()) return {&blob[0], blob.size()}; in hidlVec2KmBlob()
128 inline static keymaster_key_blob_t hidlVec2KmKeyBlob(const hidl_vec<uint8_t>& blob) { in hidlVec2KmKeyBlob() argument
130 if (blob.size()) return {&blob[0], blob.size()}; in hidlVec2KmKeyBlob()
134 inline static hidl_vec<uint8_t> kmBlob2hidlVec(const keymaster_key_blob_t& blob) { in kmBlob2hidlVec() argument
135 if (blob.key_material == nullptr || blob.key_material_size == 0) { in kmBlob2hidlVec()
138 return hidl_vec<uint8_t>(blob.key_material, blob.key_material + blob.key_material_size); in kmBlob2hidlVec()
141 inline static hidl_vec<uint8_t> kmBlob2hidlVec(const keymaster_blob_t& blob) { in kmBlob2hidlVec() argument
142 if (blob.data == nullptr || blob.data_length == 0) { in kmBlob2hidlVec()
[all …]
/system/keymaster/android_keymaster/
Dauthorization_set.cpp97 elems_[i].blob.data = new_data + (elems_[i].blob.data - indirect_data_); in reserve_indirect()
222 void* tmp = malloc(src.blob.data_length); in CopyToParamSet()
223 memcpy(tmp, src.blob.data, src.blob.data_length); in CopyToParamSet()
224 dst.blob.data = reinterpret_cast<uint8_t*>(tmp); in CopyToParamSet()
295 if (indirect_data_capacity_ - indirect_data_size_ < elem.blob.data_length) in push_back()
296 if (!reserve_indirect(2 * (indirect_data_capacity_ + elem.blob.data_length))) in push_back()
299 memcpy(indirect_data_ + indirect_data_size_, elem.blob.data, elem.blob.data_length); in push_back()
300 elem.blob.data = indirect_data_ + indirect_data_size_; in push_back()
301 indirect_data_size_ += elem.blob.data_length; in push_back()
359 buf = append_uint32_to_buf(buf, end, param.blob.data_length); in serialize()
[all …]
/system/keymaster/tests/
Dwrapped_key_test.cpp56 string blob2string(keymaster_blob_t& blob) { in blob2string() argument
57 string s(reinterpret_cast<const char*>(blob.data), blob.data_length); in blob2string()
61 string keyblob2string(keymaster_key_blob_t& blob) { in keyblob2string() argument
62 string s(reinterpret_cast<const char*>(blob.key_material), blob.key_material_size); in keyblob2string()
/system/keymaster/include/keymaster/legacy_support/
Dkeymaster1_engine.h55 keymaster_error_t DeleteKey(const KeymasterKeyBlob& blob) const;
59 KeyData(const KeymasterKeyBlob& blob, const AuthorizationSet& params) in KeyData()
60 : op_handle(0), begin_params(params), key_material(blob), error(KM_ERROR_OK), in KeyData()
71 RSA* BuildRsaKey(const KeymasterKeyBlob& blob, const AuthorizationSet& additional_params,
73 EC_KEY* BuildEcKey(const KeymasterKeyBlob& blob, const AuthorizationSet& additional_params,
82 EVP_PKEY* GetKeymaster1PublicKey(const KeymasterKeyBlob& blob,
/system/update_engine/scripts/
Dpayload_info_unittest.py145 blob = self._blobs[offset]
146 if len(blob) != length:
148 'actual: %d)' % (len(blob), length))
149 return blob
160 blob = self._payload_signatures.SerializeToString()
162 self._manifest.signatures_size = len(blob)
163 self._blobs[self._manifest.signatures_offset] = blob
169 blob = self._metadata_signatures.SerializeToString()
170 self._header.metadata_signature_len = len(blob)
171 self._blobs[-len(blob)] = blob
/system/libufdt/tests/src/
Dufdt_verify_overlay_app.cpp51 struct fdt_header *blob = nullptr; in verify_overlay_files() local
70 blob = ufdt_install_blob(final_buf, final_size); in verify_overlay_files()
71 if (!blob) { in verify_overlay_files()
76 result = ufdt_verify_dtbo(blob, final_size, overlay_buf_array, overlay_count); in verify_overlay_files()

1234