/system/update_engine/payload_generator/ |
H A D | blob_file_writer.cc | 23 off_t BlobFileWriter::StoreBlob(const brillo::Blob& blob) { argument 25 if (!utils::PWriteAll(blob_fd_, blob.data(), blob.size(), *blob_file_size_)) 29 *blob_file_size_ += blob.size();
|
H A D | blob_file_writer_unittest.cc | 43 brillo::Blob blob(blob_size); 44 FillWithData(&blob); 45 EXPECT_EQ(0, blob_file.StoreBlob(blob)); 46 EXPECT_EQ(blob_size, blob_file.StoreBlob(blob)); 56 EXPECT_EQ(blob, stored_blob);
|
H A D | annotated_operation.cc | 39 bool AnnotatedOperation::SetOperationBlob(const brillo::Blob& blob, argument 41 if (blob.empty()) { 46 off_t data_offset = blob_file->StoreBlob(blob); 49 op.set_data_length(blob.size());
|
H A D | annotated_operation.h | 38 // Writes |blob| to the end of |blob_file|. It sets the data_offset and 39 // data_length in AnnotatedOperation to match the offset and size of |blob| 41 bool SetOperationBlob(const brillo::Blob& blob, BlobFileWriter* blob_file);
|
H A D | block_mapping.cc | 34 size_t HashValue(const brillo::Blob& blob) { argument 36 return hash_fn(string(blob.begin(), blob.end())); 48 brillo::Blob blob(block_size_); 50 if (!utils::PReadAll(fd, blob.data(), block_size_, byte_offset, &bytes_read)) 54 return AddBlock(fd, byte_offset, blob); 120 brillo::Blob blob(block_size); 122 if (!utils::PReadAll(fd, blob.data(), block_size, byte_offset, &bytes_read)) 126 *equals = blob == other_block; 135 block_data = std::move(blob); [all...] |
H A D | block_mapping_unittest.cc | 65 brillo::Blob blob(block_size_); 68 blob[0] = 42; 69 EXPECT_EQ(0, bm_.AddBlock(blob)); 70 blob[0] = 5; 71 EXPECT_EQ(1, bm_.AddBlock(blob));
|
H A D | blob_file_writer.h | 35 // Store the passed |blob| in the blob file. Returns the offset at which it 37 off_t StoreBlob(const brillo::Blob& blob);
|
/system/keymaster/ |
H A D | keymaster0_engine.cpp | 150 bool Keymaster0Engine::DeleteKey(const KeymasterKeyBlob& blob) const { 153 return (keymaster0_device_->delete_keypair(keymaster0_device_, blob.key_material, 154 blob.key_material_size) == 0); 176 inline keymaster_key_blob_t* duplicate_blob(const keymaster_key_blob_t& blob) { argument 177 return duplicate_blob(blob.key_material, blob.key_material_size); 180 RSA* Keymaster0Engine::BlobToRsaKey(const KeymasterKeyBlob& blob) const { 181 // Create new RSA key (with engine methods) and insert blob 186 keymaster_key_blob_t* blob_copy = duplicate_blob(blob); 191 unique_ptr<EVP_PKEY, EVP_PKEY_Delete> pkey(GetKeymaster0PublicKey(blob)); 243 keymaster_key_blob_t* blob = reinterpret_cast<keymaster_key_blob_t*>(*from_d); local 255 keymaster_key_blob_t* blob = reinterpret_cast<keymaster_key_blob_t*>(ptr); local 278 Keymaster0Sign(const void* signing_params, const keymaster_key_blob_t& blob, const uint8_t* data, const size_t data_length, unique_ptr<uint8_t[], Malloc_Delete>* signature, size_t* signature_length) const argument [all...] |
H A D | keymaster1_engine.h | 55 keymaster_error_t DeleteKey(const KeymasterKeyBlob& blob) const; 59 KeyData(const KeymasterKeyBlob& blob, const AuthorizationSet& params) argument 60 : op_handle(0), begin_params(params), key_material(blob), error(KM_ERROR_OK), 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,
|
H A D | keymaster1_engine.cpp | 86 keymaster_key_blob_t blob; local 88 &blob, &characteristics); 91 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); 92 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); 93 key_blob->key_material_size = blob.key_material_size; 110 keymaster_key_blob_t blob; local 113 &blob, &characteristics); 116 unique_ptr<uint8_t, Malloc_Delete> blob_deleter(const_cast<uint8_t*>(blob.key_material)); 117 output_key_blob->key_material = dup_buffer(blob 136 BuildRsaKey(const KeymasterKeyBlob& blob, const AuthorizationSet& additional_params, keymaster_error_t* error) const argument 178 BuildEcKey(const KeymasterKeyBlob& blob, const AuthorizationSet& additional_params, keymaster_error_t* error) const argument 362 GetKeymaster1PublicKey(const KeymasterKeyBlob& blob, const AuthorizationSet& additional_params, keymaster_error_t* error) const argument [all...] |
H A D | openssl_utils.cpp | 65 void convert_bn_to_blob(BIGNUM* bn, keymaster_blob_t* blob) { argument 66 blob->data_length = BN_num_bytes(bn); 67 blob->data = new uint8_t[blob->data_length]; 68 BN_bn2bin(bn, const_cast<uint8_t*>(blob->data));
|
H A D | authorization_set.cpp | 97 elems_[i].blob.data = new_data + (elems_[i].blob.data - indirect_data_); 196 void* tmp = malloc(src.blob.data_length); 197 memcpy(tmp, src.blob.data, src.blob.data_length); 198 dst.blob.data = reinterpret_cast<uint8_t*>(tmp); 269 if (indirect_data_capacity_ - indirect_data_size_ < elem.blob.data_length) 270 if (!reserve_indirect(2 * (indirect_data_capacity_ + elem.blob.data_length))) 273 memcpy(indirect_data_ + indirect_data_size_, elem.blob.data, elem.blob [all...] |
H A 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;
|
H A D | key_blob_test.cpp | 103 // key_data shouldn't be anywhere in the blob, ciphertext should. 306 keymaster_key_blob_t blob = {buf.get() + i, kBufSize - i}; local 307 KeymasterKeyBlob key_blob(blob); 309 // Integrity-assured blob. 314 // Auth-encrypted OCB blob. 324 << "Somehow sucessfully parsed a blob with seed " << now << " at offset " << i; 330 keymaster_key_blob_t blob = {buf, 0}; local 331 KeymasterKeyBlob key_blob(blob); 346 keymaster_key_blob_t blob = {buf, 0}; local 347 blob [all...] |
H A D | android_keymaster_test_utils.h | 99 std::string(reinterpret_cast<const char*>(set[pos].blob.data), 100 set[pos].blob.data_length) == val; 107 std::string(reinterpret_cast<const char*>(set[pos].blob.data), 108 set[pos].blob.data_length) == val; 349 static void munge_blob(uint8_t* blob, size_t blob_length) { argument 350 if (blob && blob_length > 0 && *blob == 'P') 351 *blob = 'Q'; // Mind your Ps and Qs! 354 // Copy and un-modfy the blob. The caller must clean up the return value. 355 static uint8_t* unmunge_blob(const uint8_t* blob, size_ argument [all...] |
/system/tpm/attestation/server/ |
H A D | pkcs11_key_store_test.cc | 316 std::string blob; local 317 EXPECT_FALSE(key_store.Read(kDefaultUser, "test", &blob)); 318 EXPECT_FALSE(key_store.Write(kDefaultUser, "test", blob)); 319 EXPECT_FALSE(key_store.Read("", "test", &blob)); 320 EXPECT_FALSE(key_store.Write("", "test", blob)); 327 std::string blob; local 328 EXPECT_FALSE(key_store.Read(kDefaultUser, "test", &blob)); 330 EXPECT_TRUE(key_store.Read(kDefaultUser, "test", &blob)); 331 EXPECT_EQ("test_data", blob); 333 EXPECT_FALSE(key_store.Read(kDefaultUser, "test2", &blob)); 352 std::string blob; local 380 std::string blob; local 392 std::string blob; local 402 std::string blob; local 412 std::string blob; local 433 std::string blob; local 458 std::string blob; local 569 std::string blob; local [all...] |
/system/keymaster/include/keymaster/ |
H A D | android_keymaster_utils.h | 236 explicit KeymasterKeyBlob(const keymaster_key_blob_t& blob) { argument 238 key_material = dup_buffer(blob.key_material, blob.key_material_size); 240 key_material_size = blob.key_material_size; 243 KeymasterKeyBlob(const KeymasterKeyBlob& blob) { argument 245 key_material = dup_buffer(blob.key_material, blob.key_material_size); 247 key_material_size = blob.key_material_size; 250 void operator=(const KeymasterKeyBlob& blob) { argument 252 key_material = dup_buffer(blob [all...] |
H A 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,
|
H A D | android_keymaster_messages.h | 297 void SetKeyMaterial(const keymaster_key_blob_t& blob) { argument 298 SetKeyMaterial(blob.key_material, blob.key_material_size); 328 void SetKeyMaterial(const keymaster_key_blob_t& blob) { argument 329 SetKeyMaterial(blob.key_material, blob.key_material_size); 451 void SetKeyMaterial(const keymaster_key_blob_t& blob) { argument 452 SetKeyMaterial(blob.key_material, blob.key_material_size); 473 void SetKeyMaterial(const keymaster_key_blob_t& blob) { argument 494 SetKeyMaterial(const keymaster_key_blob_t& blob) argument 513 SetKeyMaterial(const keymaster_key_blob_t& blob) argument 533 SetKeyMaterial(const keymaster_key_blob_t& blob) argument 597 SetKeyMaterial(const keymaster_key_blob_t& blob) argument 632 SetKeyMaterial(const keymaster_key_blob_t& blob) argument [all...] |
H A D | keymaster_context.h | 96 * CreateKeyBlob takes authorization sets and key material and produces a key blob and hardware 98 * (Keystore, generally). The blob is integrity-checked and may be encrypted, depending on the 106 KeymasterKeyBlob* blob, AuthorizationSet* hw_enforced, 110 * UpgradeKeyBlob takes an existing blob, parses out key material and constructs a new blob with 118 * ParseKeyBlob takes a blob and extracts authorization sets and key material, returning an 119 * error if the blob fails integrity checking or decryption. Note that the returned key 120 * material may itself be an opaque blob usable only by secure hardware (in the hybrid case). 124 virtual keymaster_error_t ParseKeyBlob(const KeymasterKeyBlob& blob, 134 virtual keymaster_error_t DeleteKey(const KeymasterKeyBlob& /* blob */) cons [all...] |
H A 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); 229 Authorization(TypedTag<KM_BYTES, Tag> tag, const keymaster_blob_t& blob) argument 241 Authorization(TypedTag<KM_BIGNUM, Tag> tag, const keymaster_blob_t& blob) argument
|
/system/security/keystore/ |
H A D | blob.h | 29 /* Here is the file format. There are two parts in blob.value, the secret and 31 * can be found in blob.length. The description is stored after the secret in 32 * plaintext, and its size is specified in blob.info. The total size of the two 34 * the second is the blob's type, and the third byte is flags. Fields other 35 * than blob.info, blob.length, and blob.value are modified by encryptBlob() 52 struct __attribute__((packed)) blob { struct 81 Blob(blob b); 108 struct blob mBlo [all...] |
H A D | keystore.cpp | 150 Blob blob; local 151 ResponseCode rc = get(filename, &blob, ::TYPE_ANY, userId); 153 /* get can fail if the blob is encrypted and the state is 159 shouldDelete = !(rc == ::NO_ERROR && !blob.isEncrypted()); 223 * it must be read it again since the blob is encrypted each time 287 keymaster_key_blob_t blob = {keyBlob.getValue(), local 289 if (mDevice->delete_key(mDevice, &blob)) { 297 keymaster_key_blob_t blob; local 298 blob.key_material = keyBlob.getValue(); 299 blob 440 keymaster_key_blob_t blob = {nullptr, 0}; local 577 upgradeBlob(const char* filename, Blob* blob, const uint8_t oldVersion, const BlobType type, uid_t uid) argument 620 importBlobAsKey(Blob* blob, const char* filename, uid_t uid) argument [all...] |
H A D | keystore.h | 26 #include "blob.h" 42 keymaster2_device_t* getDeviceForBlob(const Blob& blob) const { 43 return blob.isFallback() ? mFallbackDevice : mDevice; 132 bool upgradeBlob(const char* filename, Blob* blob, const uint8_t oldVersion, 136 * Takes a blob that is an PEM-encoded RSA key as a byte array and converts it to a DER-encoded 137 * PKCS#8 for import into a keymaster. Then it overwrites the original blob with the new blob 140 ResponseCode importBlobAsKey(Blob* blob, const char* filename, uid_t uid);
|
H A D | key_store_service.cpp | 604 keymaster_key_blob_t blob; local 626 device->generate_key(device, &inParams, &blob, outCharacteristics ? &out : nullptr); 642 rc = fallback->generate_key(fallback, &inParams, &blob, 658 Blob keyBlob(blob.key_material, blob.key_material_size, NULL, 0, ::TYPE_KEYMASTER_10); 662 free(const_cast<uint8_t*>(blob.key_material)); 735 keymaster_key_blob_t blob; local 748 rc = device->import_key(device, &inParams, format, &input, &blob, 754 rc = fallback->import_key(fallback, &inParams, format, &input, &blob, 768 Blob keyBlob(blob 1539 upgradeKeyBlob(const String16& name, uid_t uid, const AuthorizationSet& params, Blob* blob) argument [all...] |