/system/security/keystore/ |
H A D | keyblob_utils.cpp | 26 * 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));
|
H A D | keymaster_enforcement.cpp | 430 bool KeymasterEnforcement::CreateKeyId(const hidl_vec<uint8_t>& key_blob, km_id_t* keyid) { argument 436 EVP_DigestUpdate(ctx.get(), &key_blob[0], key_blob.size()) &&
|
/system/keymaster/key_blob_utils/ |
H A D | auth_encrypted_key_blob.cpp | 34 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 D | integrity_assured_key_blob.cpp | 83 KeymasterKeyBlob* key_blob) { 90 if (!key_blob->Reset(size)) 93 uint8_t* p = key_blob->writable_data(); 95 p = key_material.Serialize(p, key_blob->end()); 96 p = hw_enforced.Serialize(p, key_blob->end()); 97 p = sw_enforced.Serialize(p, key_blob->end()); 99 return ComputeHmac(key_blob->key_material, p - key_blob->key_material, hidden, p); 102 keymaster_error_t DeserializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_blob, argument 107 const uint8_t* p = key_blob 79 SerializeIntegrityAssuredBlob(const KeymasterKeyBlob& key_material, const AuthorizationSet& hidden, const AuthorizationSet& hw_enforced, const AuthorizationSet& sw_enforced, KeymasterKeyBlob* key_blob) argument 126 DeserializeIntegrityAssuredBlob_NoHmacCheck(const KeymasterKeyBlob& key_blob, KeymasterKeyBlob* key_material, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) argument [all...] |
/system/tpm/trunks/ |
H A D | blob_parser.cc | 28 std::string* key_blob) { 29 CHECK(key_blob) << "KeyBlob not defined."; 30 key_blob->clear(); 34 TPM_RC result = Serialize_TPM2B_PUBLIC(public_info, key_blob); 39 result = Serialize_TPM2B_PRIVATE(private_info, key_blob); 47 bool BlobParser::ParseKeyBlob(const std::string& key_blob, argument 52 if (key_blob.empty()) { 57 std::string mutable_key_blob = key_blob; 26 SerializeKeyBlob(const TPM2B_PUBLIC& public_info, const TPM2B_PRIVATE& private_info, std::string* key_blob) argument
|
/system/keymaster/km_openssl/ |
H A D | symmetric_key.cpp | 34 KeymasterKeyBlob* key_blob, 37 if (!key_blob || !hw_enforced || !sw_enforced) 60 return blob_maker_.CreateKeyBlob(key_description, KM_ORIGIN_GENERATED, key_material, key_blob, 33 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
H A D | openssl_utils.cpp | 112 keymaster_error_t EvpKeyToKeyMaterial(const EVP_PKEY* pkey, KeymasterKeyBlob* key_blob) { argument 117 if (!key_blob->Reset(key_data_size)) 120 uint8_t* tmp = key_blob->writable_data();
|
H A D | rsa_key_factory.cpp | 53 KeymasterKeyBlob* key_blob, 56 if (!key_blob || !hw_enforced || !sw_enforced) 99 return blob_maker_.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 D | ec_key_factory.cpp | 75 KeymasterKeyBlob* key_blob, 78 if (!key_blob || !hw_enforced || !sw_enforced) 123 return blob_maker_.CreateKeyBlob(authorizations, KM_ORIGIN_GENERATED, key_material, key_blob, 74 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
H A D | soft_keymaster_enforcement.cpp | 65 bool SoftKeymasterEnforcement::CreateKeyId(const keymaster_key_blob_t& key_blob, argument 72 EVP_DigestUpdate(ctx.get(), key_blob.key_material, key_blob.key_material_size) &&
|
/system/keymaster/legacy_support/ |
H A D | ec_keymaster0_key.cpp | 37 KeymasterKeyBlob* key_blob, 40 if (!key_blob || !hw_enforced || !sw_enforced) 44 return super::GenerateKey(key_description, key_blob, hw_enforced, sw_enforced); 64 return blob_maker_.CreateKeyBlob(key_description, KM_ORIGIN_UNKNOWN, key_material, key_blob, 36 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
H A D | rsa_keymaster0_key.cpp | 37 KeymasterKeyBlob* key_blob, 40 if (!key_blob || !hw_enforced || !sw_enforced) 66 return blob_maker_.CreateKeyBlob(key_description, KM_ORIGIN_UNKNOWN, key_material, key_blob, 36 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
H A D | ec_keymaster1_key.cpp | 65 KeymasterKeyBlob* key_blob, 79 return engine_->GenerateKey(key_params_copy, key_blob, hw_enforced, sw_enforced); 64 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
H A D | rsa_keymaster1_key.cpp | 83 KeymasterKeyBlob* key_blob, 88 return engine_->GenerateKey(key_params_copy, key_blob, hw_enforced, sw_enforced); 82 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
H A D | keymaster0_engine.cpp | 86 uint8_t* key_blob = 0; local 87 if (keymaster0_device_->generate_keypair(keymaster0_device_, TYPE_RSA, ¶ms, &key_blob, 92 unique_ptr<uint8_t, Malloc_Delete> key_blob_deleter(key_blob); 93 key_material->key_material = dup_buffer(key_blob, key_material->key_material_size); 102 uint8_t* key_blob = 0; local 103 if (keymaster0_device_->generate_keypair(keymaster0_device_, TYPE_EC, ¶ms, &key_blob, 108 unique_ptr<uint8_t, Malloc_Delete> key_blob_deleter(key_blob); 109 key_material->key_material = dup_buffer(key_blob, key_material->key_material_size); 120 uint8_t* key_blob = 0; 122 to_import.key_material_size, &key_blob, 301 const keymaster_key_blob_t* key_blob = RsaKeyToBlob(rsa); local 345 const keymaster_key_blob_t* key_blob = EcKeyToBlob(ec_key); local [all...] |
H A D | keymaster1_engine.cpp | 79 KeymasterKeyBlob* key_blob, 82 assert(key_blob); 91 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); 92 key_blob->key_material_size = blob.key_material_size; 78 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
H A D | keymaster1_legacy_support.cpp | 205 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, 208 return software_digest_factory_.GenerateKey(key_description, key_blob, hw_enforced, 231 return passthrough_factory_.GenerateKey(mutable_key_description, key_blob, hw_enforced, 203 GenerateKey( const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
H A D | keymaster_passthrough_engine.cpp | 213 KeymasterKeyBlob* key_blob, 216 assert(key_blob); 225 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); 226 key_blob->key_material_size = blob.key_material_size; 236 KeymasterKeyBlob* key_blob, 239 assert(key_blob); 248 key_blob->key_material = dup_buffer(blob.key_material, blob.key_material_size); 249 key_blob->key_material_size = blob.key_material_size; 212 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument 235 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
/system/keymaster/include/keymaster/legacy_support/ |
H A D | keymaster1_legacy_support.h | 70 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, 73 return software_digest_factory_.GenerateKey(key_description, key_blob, hw_enforced, 76 return passthrough_factory_.GenerateKey(key_description, key_blob, hw_enforced, 138 KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, 69 GenerateKey(const AuthorizationSet& key_description, KeymasterKeyBlob* key_blob, AuthorizationSet* hw_enforced, AuthorizationSet* sw_enforced) const argument
|
/system/keymaster/android_keymaster/ |
H A D | android_keymaster_messages.cpp | 26 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 D | android_keymaster.cpp | 228 KeymasterKeyBlob key_blob; local 231 response->error = factory->GenerateKey(request.key_description, &key_blob, 234 response->key_blob = key_blob.release(); 245 context_->ParseKeyBlob(KeymasterKeyBlob(request.key_blob), request.additional_params, 265 response->error = LoadKey(request.key_blob, request.additional_params, &key_factory, &key); 285 if (!context_->enforcement_policy()->CreateKeyId(request.key_blob, &key_id)) return; 377 context_->ParseKeyBlob(KeymasterKeyBlob(request.key_blob), request.additional_params, &key); 396 response->error = LoadKey(request.key_blob, request.attest_params, 423 response->error = context_->UpgradeKeyBlob(KeymasterKeyBlob(request.key_blob), 442 KeymasterKeyBlob key_blob; local 473 LoadKey(const keymaster_key_blob_t& key_blob, const AuthorizationSet& additional_params, const KeyFactory** factory, UniquePtr<Key>* key) argument 522 KeymasterKeyBlob key_blob; local [all...] |
/system/vold/ |
H A D | Keymaster.cpp | 268 uint32_t ratelimit, const uint8_t* key_blob, 279 std::string old_key(reinterpret_cast<const char*>(key_blob), key_blob_size); 288 const uint8_t* key_blob, size_t key_blob_size, uint32_t ratelimit, const uint8_t* object, 295 if (!key_blob || !object || !signature_buffer || !signature_buffer_size) { 301 std::string key(reinterpret_cast<const char*>(key_blob), key_blob_size); 267 keymaster_upgrade_key_for_cryptfs_scrypt(uint32_t rsa_key_size, uint64_t rsa_exponent, uint32_t ratelimit, const uint8_t* key_blob, size_t key_blob_size, uint8_t* key_buffer, uint32_t key_buffer_size, uint32_t* key_out_size) argument 287 keymaster_sign_object_for_cryptfs_scrypt( const uint8_t* key_blob, size_t key_blob_size, uint32_t ratelimit, const uint8_t* object, const size_t object_size, uint8_t** signature_buffer, size_t* signature_buffer_size) argument
|
/system/vold/tests/ |
H A D | CryptfsScryptHidlizationEquivalence_test.cpp | 181 keymaster_key_blob_t key_blob; local 183 &key_blob, 191 key = (uint8_t*)key_blob.key_material; 192 key_size = key_blob.key_material_size;
|
/system/core/trusty/keymaster/ |
H A D | trusty_keymaster_device.cpp | 211 const keymaster_key_param_set_t* params, keymaster_key_blob_t* key_blob, 221 if (!key_blob) { 235 key_blob->key_material_size = response.key_blob.key_material_size; 236 key_blob->key_material = 237 DuplicateBuffer(response.key_blob.key_material, response.key_blob.key_material_size); 238 if (!key_blob->key_material) { 251 const keymaster_key_blob_t* key_blob, const keymaster_blob_t* client_id, 258 if (!key_blob || !key_blo 210 generate_key( const keymaster_key_param_set_t* params, keymaster_key_blob_t* key_blob, keymaster_key_characteristics_t* characteristics) argument 250 get_key_characteristics( 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 281 import_key( 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 671 generate_key( const keymaster2_device_t* dev, const keymaster_key_param_set_t* params, keymaster_key_blob_t* key_blob, keymaster_key_characteristics_t* characteristics) argument 678 get_key_characteristics( const keymaster2_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 687 import_key( const keymaster2_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...] |
/system/keymaster/tests/ |
H A D | android_keymaster_test_utils.h | 410 uint8_t** key_blob, size_t* key_blob_length) { 412 int result = device(dev)->generate_keypair(device(dev), key_type, key_params, key_blob, 415 munge_blob(*key_blob, *key_blob_length); 420 const size_t key_length, uint8_t** key_blob, 424 device(dev)->import_keypair(device(dev), key, key_length, key_blob, key_blob_length); 426 munge_blob(*key_blob, *key_blob_length); 431 const uint8_t* key_blob, const size_t key_blob_length, 434 std::unique_ptr<uint8_t[]> dup_blob(unmunge_blob(key_blob, key_blob_length)); 439 static int counting_delete_keypair(const struct keymaster0_device* dev, const uint8_t* key_blob, argument 442 if (key_blob 408 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 419 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 430 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 458 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 468 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...] |