/system/tpm/attestation/server/ |
D | pkcs11_key_store_test.cc | 316 std::string blob; in TEST() local 317 EXPECT_FALSE(key_store.Read(kDefaultUser, "test", &blob)); in TEST() 318 EXPECT_FALSE(key_store.Write(kDefaultUser, "test", blob)); in TEST() 319 EXPECT_FALSE(key_store.Read("", "test", &blob)); in TEST() 320 EXPECT_FALSE(key_store.Write("", "test", blob)); in TEST() 327 std::string blob; in TEST_F() local 328 EXPECT_FALSE(key_store.Read(kDefaultUser, "test", &blob)); in TEST_F() 330 EXPECT_TRUE(key_store.Read(kDefaultUser, "test", &blob)); in TEST_F() 331 EXPECT_EQ("test_data", blob); in TEST_F() 333 EXPECT_FALSE(key_store.Read(kDefaultUser, "test2", &blob)); in TEST_F() [all …]
|
/system/keymaster/ |
D | keymaster0_engine.cpp | 150 bool Keymaster0Engine::DeleteKey(const KeymasterKeyBlob& blob) const { in DeleteKey() 153 return (keymaster0_device_->delete_keypair(keymaster0_device_, blob.key_material, in DeleteKey() 154 blob.key_material_size) == 0); in DeleteKey() 176 inline keymaster_key_blob_t* duplicate_blob(const keymaster_key_blob_t& blob) { in duplicate_blob() argument 177 return duplicate_blob(blob.key_material, blob.key_material_size); in duplicate_blob() 180 RSA* Keymaster0Engine::BlobToRsaKey(const KeymasterKeyBlob& blob) const { in BlobToRsaKey() 186 keymaster_key_blob_t* blob_copy = duplicate_blob(blob); in BlobToRsaKey() 191 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(GetKeymaster0PublicKey(blob)); in BlobToRsaKey() 205 EC_KEY* Keymaster0Engine::BlobToEcKey(const KeymasterKeyBlob& blob) const { in BlobToEcKey() 211 keymaster_key_blob_t* blob_copy = duplicate_blob(blob); in BlobToEcKey() [all …]
|
D | keymaster1_engine.cpp | 86 keymaster_key_blob_t blob; in GenerateKey() local 88 &blob, &characteristics); in GenerateKey() 91 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in GenerateKey() 92 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in GenerateKey() 93 key_blob->key_material_size = blob.key_material_size; in GenerateKey() 110 keymaster_key_blob_t blob; in ImportKey() local 113 &blob, &characteristics); in ImportKey() 116 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); in ImportKey() 117 output_key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); in ImportKey() 118 output_key_blob->key_material_size = blob.key_material_size; in ImportKey() [all …]
|
D | authorization_set.cpp | 97 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 …]
|
D | keymaster1_engine.h | 55 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,
|
D | soft_keymaster_context.cpp | 452 KeymasterKeyBlob* blob, in CreateKeyBlob() argument 465 return SerializeIntegrityAssuredBlob(key_material, hidden, *hw_enforced, *sw_enforced, blob); in CreateKeyBlob() 528 static keymaster_error_t ParseOcbAuthEncryptedBlob(const KeymasterKeyBlob& blob, in ParseOcbAuthEncryptedBlob() argument 535 keymaster_error_t error = DeserializeAuthEncryptedBlob(blob, &encrypted_key_material, in ParseOcbAuthEncryptedBlob() 552 const KeymasterKeyBlob& blob, KeymasterKeyBlob* key_material, AuthorizationSet* hw_enforced, in ParseOldSoftkeymasterBlob() argument 556 const uint8_t* p = blob.key_material; in ParseOldSoftkeymasterBlob() 557 const uint8_t* end = blob.key_material + blob.key_material_size; in ParseOldSoftkeymasterBlob() 623 keymaster_error_t SoftKeymasterContext::ParseKeyBlob(const KeymasterKeyBlob& blob, in ParseKeyBlob() argument 667 error = DeserializeIntegrityAssuredBlob(blob, hidden, key_material, hw_enforced, sw_enforced); in ParseKeyBlob() 672 error = ParseOcbAuthEncryptedBlob(blob, hidden, key_material, hw_enforced, sw_enforced); in ParseKeyBlob() [all …]
|
D | openssl_utils.cpp | 65 void convert_bn_to_blob(BIGNUM* bn, keymaster_blob_t* blob) { in convert_bn_to_blob() argument 66 blob->data_length = BN_num_bytes(bn); in convert_bn_to_blob() 67 blob->data = new uint8_t[blob->data_length]; in convert_bn_to_blob() 68 BN_bn2bin(bn, const_cast<uint8_t*>(blob->data)); in convert_bn_to_blob()
|
D | keymaster0_engine.h | 53 bool DeleteKey(const KeymasterKeyBlob& blob) const; 56 RSA* BlobToRsaKey(const KeymasterKeyBlob& blob) const; 57 EC_KEY* BlobToEcKey(const KeymasterKeyBlob& blob) const; 64 EVP_PKEY* GetKeymaster0PublicKey(const KeymasterKeyBlob& blob) const;
|
D | key_blob_test.cpp | 306 keymaster_key_blob_t blob = {buf.get() + i, kBufSize - i}; in TEST_F() local 307 KeymasterKeyBlob key_blob(blob); in TEST_F() 330 keymaster_key_blob_t blob = {buf, 0}; in TEST_F() local 331 KeymasterKeyBlob key_blob(blob); in TEST_F() 346 keymaster_key_blob_t blob = {buf, 0}; in TEST_F() local 347 blob.key_material_size = 16 * 1024 * 1024 + 1; in TEST_F() 348 KeymasterKeyBlob key_blob(blob); in TEST_F()
|
D | android_keymaster_test_utils.h | 99 std::string(reinterpret_cast<const char*>(set[pos].blob.data), in contains() 100 set[pos].blob.data_length) == val; in contains() 107 std::string(reinterpret_cast<const char*>(set[pos].blob.data), in contains() 108 set[pos].blob.data_length) == val; in contains() 349 static void munge_blob(uint8_t* blob, size_t blob_length) { in munge_blob() 350 if (blob && blob_length > 0 && *blob == 'P') in munge_blob() 351 *blob = 'Q'; // Mind your Ps and Qs! in munge_blob() 355 static uint8_t* unmunge_blob(const uint8_t* blob, size_t blob_length) { in unmunge_blob() 356 uint8_t* dup_blob = dup_buffer(blob, blob_length); in unmunge_blob()
|
/system/update_engine/payload_generator/ |
D | block_mapping.cc | 34 size_t HashValue(const brillo::Blob& blob) { in HashValue() argument 36 return hash_fn(string(blob.begin(), blob.end())); in HashValue() 48 brillo::Blob blob(block_size_); in AddDiskBlock() local 50 if (!utils::PReadAll(fd, blob.data(), block_size_, byte_offset, &bytes_read)) in AddDiskBlock() 54 return AddBlock(fd, byte_offset, blob); in AddDiskBlock() 120 brillo::Blob blob(block_size); in CompareData() local 122 if (!utils::PReadAll(fd, blob.data(), block_size, byte_offset, &bytes_read)) in CompareData() 126 *equals = blob == other_block; in CompareData() 135 block_data = std::move(blob); in CompareData()
|
D | blob_file_writer_unittest.cc | 43 brillo::Blob blob(blob_size); in TEST() local 44 FillWithData(&blob); in TEST() 45 EXPECT_EQ(0, blob_file.StoreBlob(blob)); in TEST() 46 EXPECT_EQ(blob_size, blob_file.StoreBlob(blob)); in TEST() 56 EXPECT_EQ(blob, stored_blob); in TEST()
|
D | blob_file_writer.cc | 23 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()
|
D | annotated_operation.cc | 39 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()
|
D | block_mapping_unittest.cc | 65 brillo::Blob blob(block_size_); in TEST_F() local 68 blob[0] = 42; in TEST_F() 69 EXPECT_EQ(0, bm_.AddBlock(blob)); in TEST_F() 70 blob[0] = 5; in TEST_F() 71 EXPECT_EQ(1, bm_.AddBlock(blob)); in TEST_F()
|
/system/keymaster/include/keymaster/ |
D | android_keymaster_utils.h | 236 explicit KeymasterKeyBlob(const keymaster_key_blob_t& blob) { in KeymasterKeyBlob() 238 key_material = dup_buffer(blob.key_material, blob.key_material_size); in KeymasterKeyBlob() 240 key_material_size = blob.key_material_size; in KeymasterKeyBlob() 243 KeymasterKeyBlob(const KeymasterKeyBlob& blob) { in KeymasterKeyBlob() 245 key_material = dup_buffer(blob.key_material, blob.key_material_size); in KeymasterKeyBlob() 247 key_material_size = blob.key_material_size; in KeymasterKeyBlob() 250 void operator=(const KeymasterKeyBlob& blob) { 252 key_material = dup_buffer(blob.key_material, blob.key_material_size); 253 key_material_size = blob.key_material_size;
|
D | android_keymaster_messages.h | 297 void SetKeyMaterial(const keymaster_key_blob_t& blob) { in SetKeyMaterial() 298 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial() 328 void SetKeyMaterial(const keymaster_key_blob_t& blob) { in SetKeyMaterial() 329 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial() 451 void SetKeyMaterial(const keymaster_key_blob_t& blob) { in SetKeyMaterial() 452 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial() 473 void SetKeyMaterial(const keymaster_key_blob_t& blob) { in SetKeyMaterial() 474 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial() 494 void SetKeyMaterial(const keymaster_key_blob_t& blob) { in SetKeyMaterial() 495 SetKeyMaterial(blob.key_material, blob.key_material_size); in SetKeyMaterial() [all …]
|
D | soft_keymaster_context.h | 68 const KeymasterKeyBlob& key_material, KeymasterKeyBlob* blob, 74 keymaster_error_t ParseKeyBlob(const KeymasterKeyBlob& blob, 78 keymaster_error_t DeleteKey(const KeymasterKeyBlob& blob) const override; 99 keymaster_error_t ParseOldSoftkeymasterBlob(const KeymasterKeyBlob& blob, 103 keymaster_error_t ParseKeymaster1HwBlob(const KeymasterKeyBlob& blob, 108 keymaster_error_t ParseKeymaster0HwBlob(const KeymasterKeyBlob& blob,
|
D | keymaster_tags.h | 230 const keymaster_blob_t& blob) { 231 return keymaster_param_blob(tag, blob.data, blob.data_length); 242 const keymaster_blob_t& blob) { 243 return keymaster_param_blob(tag, blob.data, blob.data_length);
|
D | keymaster_context.h | 106 KeymasterKeyBlob* blob, AuthorizationSet* hw_enforced, 124 virtual keymaster_error_t ParseKeyBlob(const KeymasterKeyBlob& blob,
|
/system/security/keystore/ |
D | keystore.cpp | 166 Blob blob; in resetUser() local 167 ResponseCode rc = get(filename, &blob, ::TYPE_ANY, userId); in resetUser() 175 shouldDelete = !(rc == ::NO_ERROR && !blob.isEncrypted()); in resetUser() 310 keymaster_key_blob_t blob = {keyBlob.getValue(), in del() local 312 if (mDevice->delete_key(mDevice, &blob)) { in del() 320 keymaster_key_blob_t blob; in del() local 321 blob.key_material = keyBlob.getValue(); in del() 322 blob.key_material_size = keyBlob.getLength(); in del() 323 dev->delete_key(dev, &blob); in del() 463 keymaster_key_blob_t blob = {nullptr, 0}; in importKey() local [all …]
|
D | blob.h | 52 struct __attribute__((packed)) blob { struct 82 Blob(blob b); argument 109 struct blob mBlob;
|
D | keystore.h | 42 keymaster2_device_t* getDeviceForBlob(const Blob& blob) const { in getDeviceForBlob() argument 43 return blob.isFallback() ? mFallbackDevice : mDevice; in getDeviceForBlob() 134 bool upgradeBlob(const char* filename, Blob* blob, const uint8_t oldVersion, 142 ResponseCode importBlobAsKey(Blob* blob, const char* filename, uid_t uid);
|
D | key_store_service.cpp | 618 keymaster_key_blob_t blob; in generateKey() local 653 device->generate_key(device, &inParams, &blob, outCharacteristics ? &out : nullptr); in generateKey() 669 rc = fallback->generate_key(fallback, &inParams, &blob, in generateKey() 686 Blob keyBlob(blob.key_material, blob.key_material_size, NULL, 0, ::TYPE_KEYMASTER_10); in generateKey() 690 free(const_cast<uint8_t*>(blob.key_material)); in generateKey() 776 keymaster_key_blob_t blob; in importKey() local 802 rc = device->import_key(device, &inParams, format, &input, &blob, in importKey() 808 rc = fallback->import_key(fallback, &inParams, format, &input, &blob, in importKey() 823 Blob keyBlob(blob.key_material, blob.key_material_size, NULL, 0, ::TYPE_KEYMASTER_10); in importKey() 827 free(const_cast<uint8_t*>(blob.key_material)); in importKey() [all …]
|
/system/bt/service/ |
D | gatt_server_old.cpp | 86 std::vector<uint8_t> blob; member 171 std::swap(ch.blob, ch.next_blob); in RequestReadCallback() 176 std::min(ch.blob.size(), ch.blob_section * kMaxGattAttributeSize); in RequestReadCallback() 177 const size_t blob_remaining = ch.blob.size() - blob_offset_octets; in RequestReadCallback() 191 std::copy(ch.blob.begin() + blob_offset_octets + attribute_offset_octets, in RequestReadCallback() 192 ch.blob.begin() + blob_offset_octets + attribute_size, in RequestReadCallback() 219 ch.blob.resize(attribute_offset + length); in RequestWriteCallback() 221 std::copy(value, value + length, ch.blob.begin() + attribute_offset); in RequestWriteCallback() 226 ch.blob.size() == 1u) { in RequestWriteCallback() 227 g_internal->characteristics[target_blob->second].blob_section = ch.blob[0]; in RequestWriteCallback() [all …]
|