Searched refs:key_blob (Results 1 - 25 of 36) sorted by relevance

12

/system/security/keystore/
H A Dkeyblob_utils.cpp26 * to a hardware keymaster implementation, the first 4 bytes of the key_blob
49 uint8_t* add_softkey_header(uint8_t* key_blob, size_t key_blob_length) { argument
54 memcpy(key_blob, SOFT_KEY_MAGIC, sizeof(SOFT_KEY_MAGIC));
56 return key_blob + sizeof(SOFT_KEY_MAGIC);
59 bool is_softkey(const uint8_t* key_blob, const size_t key_blob_length) { argument
64 return !memcmp(key_blob, SOFT_KEY_MAGIC, sizeof(SOFT_KEY_MAGIC));
/system/keymaster/
H A Dauth_encrypted_key_blob.cpp34 KeymasterKeyBlob* key_blob) {
39 if (!key_blob->Reset(size))
42 uint8_t* buf = key_blob->writable_data();
43 const uint8_t* end = key_blob->key_material + key_blob->key_material_size;
51 if (buf != key_blob->key_material + key_blob->key_material_size)
57 static keymaster_error_t DeserializeUnversionedBlob(const KeymasterKeyBlob& key_blob, argument
62 const uint8_t* tmp = key_blob.key_material;
64 const uint8_t* end = tmp + key_blob
29 SerializeAuthEncryptedBlob(const KeymasterKeyBlob& encrypted_key_material, const AuthorizationSet& hw_enforced, const AuthorizationSet& sw_enforced, const Buffer& nonce, const Buffer& tag, KeymasterKeyBlob* key_blob) argument
82 DeserializeAuthEncryptedBlob(const KeymasterKeyBlob& key_blob, KeymasterKeyBlob* encrypted_key_material, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced, Buffer* nonce, Buffer* tag) argument
[all...]
H A Dauth_encrypted_key_blob.h32 KeymasterKeyBlob* key_blob);
34 keymaster_error_t DeserializeAuthEncryptedBlob(const KeymasterKeyBlob& key_blob,
H A Dintegrity_assured_key_blob.h32 KeymasterKeyBlob* key_blob);
34 keymaster_error_t DeserializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_blob,
H A Dintegrity_assured_key_blob.cpp84 KeymasterKeyBlob* key_blob) {
91 if (!key_blob->Reset(size))
94 uint8_t* p = key_blob->writable_data();
96 p = key_material.Serialize(p, key_blob->end());
97 p = hw_enforced.Serialize(p, key_blob->end());
98 p = sw_enforced.Serialize(p, key_blob->end());
100 return ComputeHmac(key_blob->key_material, p - key_blob->key_material, hidden, p);
103 keymaster_error_t DeserializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_blob, argument
108 const uint8_t* p = key_blob
80 SerializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_material, const AuthorizationSet& hidden, const AuthorizationSet& hw_enforced, const AuthorizationSet& sw_enforced, KeymasterKeyBlob* key_blob) argument
[all...]
H A Dandroid_keymaster_messages.cpp26 static void set_key_blob(keymaster_key_blob_t* key_blob, const void* key_material, size_t length) { argument
27 delete[] key_blob->key_material;
28 key_blob->key_material = dup_buffer(key_material, length);
29 key_blob->key_material_size = length;
32 static size_t key_blob_size(const keymaster_key_blob_t& key_blob) { argument
33 return sizeof(uint32_t) /* key size */ + key_blob.key_material_size;
36 static uint8_t* serialize_key_blob(const keymaster_key_blob_t& key_blob, uint8_t* buf, argument
38 return append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size);
41 static bool deserialize_key_blob(keymaster_key_blob_t* key_blob, cons argument
[all...]
H A Dopenssl_utils.cpp71 keymaster_error_t EvpKeyToKeyMaterial(const EVP_PKEY* pkey, KeymasterKeyBlob* key_blob) { argument
76 if (!key_blob->Reset(key_data_size))
79 uint8_t* tmp = key_blob->writable_data();
H A Dsoft_keymaster_device.cpp180 const void* key_params, uint8_t** key_blob,
186 if (!key_blob || !key_blob_length)
226 *key_blob_length = rsp.key_blob.key_material_size;
227 *key_blob = static_cast<uint8_t*>(malloc(*key_blob_length));
228 if (!*key_blob) {
232 memcpy(*key_blob, rsp.key_blob.key_material, *key_blob_length);
240 const size_t key_length, uint8_t** key_blob,
247 if (!key_blob || !key_blob_length)
267 *key_blob_length = response.key_blob
178 generate_keypair(const keymaster1_device_t* dev, const keymaster_keypair_t key_type, const void* key_params, uint8_t** key_blob, size_t* key_blob_length) argument
239 import_keypair(const keymaster1_device_t* dev, const uint8_t* key, const size_t key_length, uint8_t** key_blob, size_t* key_blob_length) argument
316 get_keypair_public(const struct keymaster1_device* dev, const uint8_t* key_blob, const size_t key_blob_length, uint8_t** x509_data, size_t* x509_data_length) argument
349 delete_keypair(const struct keymaster1_device* dev, const uint8_t* key_blob, const size_t key_blob_length) argument
366 sign_data(const keymaster1_device_t* dev, const void* params, const uint8_t* key_blob, const size_t key_blob_length, const uint8_t* data, const size_t data_length, uint8_t** signed_data, size_t* signed_data_length) argument
422 verify_data(const keymaster1_device_t* dev, const void* params, const uint8_t* key_blob, const size_t key_blob_length, const uint8_t* signed_data, const size_t signed_data_length, const uint8_t* signature, const size_t signature_length) argument
662 generate_key( const keymaster1_device_t* dev, const keymaster_key_param_set_t* params, keymaster_key_blob_t* key_blob, keymaster_key_characteristics_t** characteristics) argument
696 get_key_characteristics( const keymaster1_device_t* dev, const keymaster_key_blob_t* key_blob, const keymaster_blob_t* client_id, const keymaster_blob_t* app_data, keymaster_key_characteristics_t** characteristics) argument
722 import_key( const keymaster1_device_t* dev, const keymaster_key_param_set_t* params, keymaster_key_format_t key_format, const keymaster_blob_t* key_data, keymaster_key_blob_t* key_blob, keymaster_key_characteristics_t** characteristics) argument
[all...]
H A Dkeymaster0_engine.cpp119 uint8_t* key_blob = 0; local
120 if (keymaster0_device_->generate_keypair(keymaster0_device_, TYPE_RSA, &params, &key_blob,
125 unique_ptr<uint8_t, Malloc_Delete> key_blob_deleter(key_blob);
126 key_material->key_material = dup_buffer(key_blob, key_material->key_material_size);
135 uint8_t* key_blob = 0; local
136 if (keymaster0_device_->generate_keypair(keymaster0_device_, TYPE_EC, &params, &key_blob,
141 unique_ptr<uint8_t, Malloc_Delete> key_blob_deleter(key_blob);
142 key_material->key_material = dup_buffer(key_blob, key_material->key_material_size);
153 uint8_t* key_blob = 0;
155 to_import.key_material_size, &key_blob,
315 const keymaster_key_blob_t* key_blob = RsaKeyToBlob(rsa); local
362 const keymaster_key_blob_t* key_blob = EcKeyToBlob(ec_key); local
[all...]
H A Dandroid_keymaster.cpp175 KeymasterKeyBlob key_blob; local
178 response->error = factory->GenerateKey(request.key_description, &key_blob,
181 response->key_blob = key_blob.release();
192 context_->ParseKeyBlob(KeymasterKeyBlob(request.key_blob), request.additional_params,
222 response->error = LoadKey(request.key_blob, request.additional_params, &hw_enforced,
245 if (!context_->enforcement_policy()->CreateKeyId(request.key_blob, &key_id))
337 context_->ParseKeyBlob(KeymasterKeyBlob(request.key_blob), request.additional_params,
374 KeymasterKeyBlob key_blob; local
376 KeymasterKeyBlob(key_material), &key_blob,
395 LoadKey(const keymaster_key_blob_t& key_blob, const AuthorizationSet& additional_params, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced, const KeyFactory** factory, UniquePtr<Key>* key) argument
[all...]
H A Dkey_blob_test.cpp307 KeymasterKeyBlob key_blob(blob);
311 DeserializeIntegrityAssuredBlob(key_blob, hidden_, &key_material_, &hw_enforced_,
316 key_blob, &ciphertext_, &hw_enforced_, &sw_enforced_, &nonce_, &tag_);
331 KeymasterKeyBlob key_blob(blob);
332 EXPECT_NE(nullptr, key_blob.key_material);
333 EXPECT_EQ(0U, key_blob.key_material_size);
336 DeserializeIntegrityAssuredBlob(key_blob, hidden_, &key_material_, &hw_enforced_,
340 DeserializeAuthEncryptedBlob(key_blob, &ciphertext_, &hw_enforced_, &sw_enforced_,
348 KeymasterKeyBlob key_blob(blob);
349 EXPECT_EQ(nullptr, key_blob
[all...]
H A Dsymmetric_key.cpp35 KeymasterKeyBlob* key_blob,
38 if (!key_blob || !hw_enforced || !sw_enforced)
61 return context_->CreateKeyBlob(key_description, KM_ORIGIN_GENERATED, key_material, key_blob,
34 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
H A Dec_keymaster0_key.cpp38 KeymasterKeyBlob* key_blob,
41 if (!key_blob || !hw_enforced || !sw_enforced)
45 return super::GenerateKey(key_description, key_blob, hw_enforced, sw_enforced);
63 return context_->CreateKeyBlob(key_description, KM_ORIGIN_UNKNOWN, key_material, key_blob,
37 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
H A Drsa_keymaster0_key.cpp40 KeymasterKeyBlob* key_blob,
43 if (!key_blob || !hw_enforced || !sw_enforced)
47 return super::GenerateKey(key_description, key_blob, hw_enforced, sw_enforced);
72 return context_->CreateKeyBlob(key_description, KM_ORIGIN_UNKNOWN, key_material, key_blob,
39 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
H A Dandroid_keymaster_test_utils.h375 uint8_t** key_blob, size_t* key_blob_length) {
377 int result = device(dev)->generate_keypair(device(dev), key_type, key_params, key_blob,
380 munge_blob(*key_blob, *key_blob_length);
385 const size_t key_length, uint8_t** key_blob,
389 device(dev)->import_keypair(device(dev), key, key_length, key_blob, key_blob_length);
391 munge_blob(*key_blob, *key_blob_length);
396 const uint8_t* key_blob, const size_t key_blob_length,
399 std::unique_ptr<uint8_t[]> dup_blob(unmunge_blob(key_blob, key_blob_length));
404 static int counting_delete_keypair(const struct keymaster0_device* dev, const uint8_t* key_blob, argument
408 std::unique_ptr<uint8_t[]> dup_blob(unmunge_blob(key_blob, key_blob_lengt
373 counting_generate_keypair(const struct keymaster0_device* dev, const keymaster_keypair_t key_type, const void* key_params, uint8_t** key_blob, size_t* key_blob_length) argument
384 counting_import_keypair(const struct keymaster0_device* dev, const uint8_t* key, const size_t key_length, uint8_t** key_blob, size_t* key_blob_length) argument
395 counting_get_keypair_public(const struct keymaster0_device* dev, const uint8_t* key_blob, const size_t key_blob_length, uint8_t** x509_data, size_t* x509_data_length) argument
421 counting_sign_data(const struct keymaster0_device* dev, const void* signing_params, const uint8_t* key_blob, const size_t key_blob_length, const uint8_t* data, const size_t data_length, uint8_t** signed_data, size_t* signed_data_length) argument
431 counting_verify_data(const struct keymaster0_device* dev, const void* signing_params, const uint8_t* key_blob, const size_t key_blob_length, const uint8_t* signed_data, const size_t signed_data_length, const uint8_t* signature, const size_t signature_length) argument
[all...]
H A Dec_key_factory.cpp44 KeymasterKeyBlob* key_blob,
47 if (!key_blob || !hw_enforced || !sw_enforced)
87 return context_->CreateKeyBlob(authorizations, KM_ORIGIN_GENERATED, key_material, key_blob,
43 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
H A Drsa_key_factory.cpp53 KeymasterKeyBlob* key_blob,
56 if (!key_blob || !hw_enforced || !sw_enforced)
95 return context_->CreateKeyBlob(authorizations, KM_ORIGIN_GENERATED, key_material, key_blob,
52 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
H A Dandroid_keymaster_messages_test.cpp143 rsp.key_blob.key_material = dup_array(TEST_DATA);
144 rsp.key_blob.key_material_size = array_length(TEST_DATA);
158 rsp.key_blob.key_material = dup_array(TEST_DATA);
159 rsp.key_blob.key_material_size = array_length(TEST_DATA);
166 EXPECT_EQ(0U, deserialized->key_blob.key_material_size);
178 EXPECT_EQ(3U, deserialized->key_blob.key_material_size);
179 EXPECT_EQ(0, memcmp(deserialized->key_blob.key_material, "foo", 3));
205 EXPECT_EQ(3U, deserialized->key_blob.key_material_size);
206 EXPECT_EQ(0, memcmp(deserialized->key_blob.key_material, "foo", 3));
399 EXPECT_EQ(msg.key_blob
[all...]
H A Dec_keymaster0_key.h42 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced,
/system/security/keystore/include/keystore/
H A Dkeystore.h68 uint8_t* add_softkey_header(uint8_t* key_blob, size_t key_blob_length);
73 bool is_softkey(const uint8_t* key_blob, const size_t key_blob_length);
/system/security/softkeymaster/include/keymaster/
H A Dsoftkeymaster.h26 const size_t key_length, uint8_t** key_blob, size_t* key_blob_length);
28 int openssl_get_keypair_public(const struct keymaster0_device* dev, const uint8_t* key_blob,
/system/keymaster/include/keymaster/
H A Dandroid_keymaster_messages.h228 key_blob.key_material = NULL;
229 key_blob.key_material_size = 0;
237 keymaster_key_blob_t key_blob; member in struct:keymaster::GenerateKeyResponse
245 key_blob.key_material = NULL;
246 key_blob.key_material_size = 0;
259 keymaster_key_blob_t key_blob; member in struct:keymaster::GetKeyCharacteristicsRequest
276 key_blob.key_material = NULL;
277 key_blob.key_material_size = 0;
279 ~BeginOperationRequest() { delete[] key_blob.key_material; }
291 keymaster_key_blob_t key_blob; member in struct:keymaster::BeginOperationRequest
434 keymaster_key_blob_t key_blob; member in struct:keymaster::ImportKeyResponse
457 keymaster_key_blob_t key_blob; member in struct:keymaster::ExportKeyRequest
494 keymaster_key_blob_t key_blob; member in struct:keymaster::DeleteKeyRequest
[all...]
H A Dsoft_keymaster_device.h89 const size_t key_length, uint8_t** key_blob, size_t* key_blob_length);
90 static int get_keypair_public(const keymaster1_device_t* dev, const uint8_t* key_blob,
93 static int delete_keypair(const struct keymaster1_device* dev, const uint8_t* key_blob,
97 const uint8_t* key_blob, const size_t key_blob_length, const uint8_t* data,
101 const uint8_t* key_blob, const size_t key_blob_length,
136 keymaster_key_blob_t* key_blob,
139 const keymaster_key_blob_t* key_blob,
147 keymaster_key_blob_t* key_blob,
H A Dec_key_factory.h35 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced,
H A Dkey_factory.h41 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced,

Completed in 261 milliseconds

12