/system/keymint/tests/src/bin/ |
D | encrypted-keyblob-parse.rs | 17 use kmr_common::keyblob::legacy::EncryptedKeyBlob; 52 let keyblob = match EncryptedKeyBlob::deserialize(&data) { in process() localVariable 62 keyblob.format, in process() 63 hex::encode(&keyblob.nonce), in process() 64 keyblob.ciphertext.len(), in process() 65 hex::encode(&keyblob.tag) in process() 67 if let Some(kdf_version) = keyblob.kdf_version { in process() 70 if let Some(addl_info) = keyblob.addl_info { in process() 73 println!(" hw_enforced={:?},\n sw_enforced={:?},", keyblob.hw_enforced, keyblob.sw_enforced); in process() 74 if let Some(key_slot) = keyblob.key_slot { in process() [all …]
|
D | auth-keyblob-parse.rs | 23 keyblob::{legacy::KeyBlob, *}, 76 let keyblob = match KeyBlob::deserialize(&hmac, &data, &hidden, BoringEq) { in process() localVariable 86 keyblob.key_material.len(), in process() 87 keyblob.hw_enforced, in process() 88 keyblob.sw_enforced in process() 94 let regenerated_data = keyblob.serialize(&hmac, &hidden).unwrap(); in process() 99 let mut combined = keyblob.hw_enforced.clone(); in process() 100 combined.extend_from_slice(&keyblob.sw_enforced); in process() 105 let raw_key = keyblob.key_material.clone(); in process() 149 let mut filtered = keyblob.hw_enforced.clone(); in process() [all …]
|
/system/security/keystore2/src/ |
D | km_compat.rs | 90 fn wrap_keyblob(keyblob: &[u8]) -> anyhow::Result<Vec<u8>> { in wrap_keyblob() 91 let mut result = Vec::with_capacity(KEYBLOB_PREFIX.len() + keyblob.len() + HMAC_SHA256_LEN); in wrap_keyblob() 93 result.extend_from_slice(keyblob); in wrap_keyblob() 94 let tag = hmac_sha256(KEYBLOB_HMAC_KEY, keyblob) in wrap_keyblob() 102 pub fn unwrap_keyblob(keyblob: &[u8]) -> KeyBlob { in unwrap_keyblob() 103 if !keyblob.starts_with(KEYBLOB_PREFIX) { in unwrap_keyblob() 104 return KeyBlob::Raw(keyblob); in unwrap_keyblob() 106 let without_prefix = &keyblob[KEYBLOB_PREFIX.len()..]; in unwrap_keyblob() 108 return KeyBlob::Raw(keyblob); in unwrap_keyblob() 115 return KeyBlob::Raw(keyblob); in unwrap_keyblob() [all …]
|
/system/keymint/common/src/bin/ |
D | keyblob-cddl-dump.rs | 15 use kmr_common::{crypto, keyblob}; 68 schema.add(keyblob::EncryptedKeyBlob::V1(keyblob::EncryptedKeyBlobV1 { in main() 78 secure_deletion_slot: Some(keyblob::SecureDeletionSlot(1)), in main() 80 schema.add(keyblob::Version::V1); in main() 81 schema.add(keyblob::EncryptedKeyBlobV1 { in main() 91 secure_deletion_slot: Some(keyblob::SecureDeletionSlot(1)), in main() 104 schema.add(keyblob::SecureDeletionSlot(1)); in main() 105 schema.add(keyblob::SecureDeletionData { in main() 109 schema.add(keyblob::RootOfTrustInfo { in main()
|
/system/keymint/tests/tests/ |
D | keyblob_test.rs | 21 use kmr_common::{crypto, crypto::Rng, expect_err, keyblob, keyblob::legacy::KeyBlob}; 36 let plaintext_keyblob = keyblob::PlaintextKeyBlob { in test_encrypted_keyblob_roundtrip() 52 let encrypted_keyblob = keyblob::encrypt( in test_encrypted_keyblob_roundtrip() 62 keyblob::SlotPurpose::KeyGeneration, in test_encrypted_keyblob_roundtrip() 67 keyblob::decrypt(None, &aes, &hmac, &root_key, encrypted_keyblob, hidden).unwrap(); in test_encrypted_keyblob_roundtrip() 73 let hidden = kmr_common::keyblob::legacy::hidden(&[], &[b"SW"]).unwrap(); in test_serialize_authenticated_legacy_keyblob() 111 let hidden = kmr_common::keyblob::legacy::hidden(&[], &[b"SW"]).unwrap(); in test_deserialize_authenticated_legacy_keyblob_fail() 164 let hidden = kmr_common::keyblob::legacy::hidden(&[], &[b"SW"]).unwrap(); in test_deserialize_authenticated_legacy_keyblob_truncated()
|
/system/keymint/scripts/ |
D | cddl-gen | 6 cargo run --bin keyblob-cddl-dump > common/src/keyblob/keyblob.cddl
|
/system/keymint/ta/src/ |
D | keys.rs | 24 der_err, get_bool_tag_value, get_opt_tag_value, get_tag_value, keyblob, km_err, tag, 277 keyblob::SlotPurpose::KeyGeneration, in generate_key() 351 keyblob::SlotPurpose::KeyImport, in import_key() 362 purpose: keyblob::SlotPurpose, in finish_keyblob_creation() 364 let keyblob = keyblob::PlaintextKeyBlob { in finish_keyblob_creation() localVariable 376 if let Some(spki) = keyblob.key_material.subject_public_key_info( in finish_keyblob_creation() 439 let algo_hint = match &keyblob.key_material { in finish_keyblob_creation() 496 let encrypted_keyblob = keyblob::encrypt( in finish_keyblob_creation() 507 keyblob, in finish_keyblob_creation() 531 let keyblob::PlaintextKeyBlob { characteristics, key_material } = wrapping_key; in import_wrapped_key() localVariable [all …]
|
D | lib.rs | 28 keyblob::{self, RootOfTrustInfo, SecureDeletionSlot}, 378 ) -> Result<(keyblob::PlaintextKeyBlob, Option<SecureDeletionSlot>), Error> { in keyblob_parse_decrypt_backlevel() 379 let encrypted_keyblob = match keyblob::EncryptedKeyBlob::new(key_blob) { in keyblob_parse_decrypt_backlevel() 397 let keyblob = keyblob::decrypt( in keyblob_parse_decrypt_backlevel() localVariable 408 Ok((keyblob, sdd_slot)) in keyblob_parse_decrypt_backlevel() 416 ) -> Result<(keyblob::PlaintextKeyBlob, Option<SecureDeletionSlot>), Error> { in keyblob_parse_decrypt() 417 let (keyblob, slot) = self.keyblob_parse_decrypt_backlevel(key_blob, params)?; in keyblob_parse_decrypt() 440 let key_chars = keyblob.characteristics_at(self.hw_info.security_level)?; in keyblob_parse_decrypt() 489 Ok((keyblob, slot)) in keyblob_parse_decrypt() 493 fn key_id(&self, keyblob: &[u8]) -> Result<KeyId, Error> { in key_id() [all …]
|
D | device.rs | 20 crypto, crypto::aes, crypto::hmac, crypto::KeyMaterial, crypto::OpaqueOr, keyblob, log_unimpl, 48 pub sdd_mgr: Option<Box<dyn keyblob::SecureDeletionSecretManager>>, 61 pub legacy_key: Option<Box<dyn keyblob::LegacyKeyHandler>>,
|
D | operation.rs | 21 get_bool_tag_value, get_opt_tag_value, get_tag_value, keyblob, km_err, tag, try_to_vec, Error, 64 pub slot_to_delete: Option<keyblob::SecureDeletionSlot>, 172 let (keyblob, sdd_slot) = self.keyblob_parse_decrypt(key_blob, ¶ms)?; in begin_operation() 173 let keyblob::PlaintextKeyBlob { characteristics, key_material } = keyblob; in begin_operation() localVariable
|
D | rkp.rs | 29 use kmr_common::{keyblob, km_err, rpc_err, try_to_vec, Error, FallibleAllocExt}; 193 keyblob::SlotPurpose::KeyGeneration, in generate_ecdsa_p256_keypair()
|
/system/keymint/common/fuzz/ |
D | Cargo.toml | 23 name = "keyblob" 24 path = "fuzz_targets/keyblob.rs"
|
/system/keymint/common/src/crypto/ |
D | traits.rs | 17 use crate::{crypto::ec::Key, der_err, explicit, keyblob, vec_try, Error}; 681 impl keyblob::SecureDeletionSecretManager for NoOpSdsManager { 685 ) -> Result<keyblob::SecureDeletionData, Error> { in get_or_create_factory_reset_secret() 689 fn get_factory_reset_secret(&self) -> Result<keyblob::SecureDeletionData, Error> { in get_factory_reset_secret() 696 _purpose: keyblob::SlotPurpose, in new_secret() 697 ) -> Result<(keyblob::SecureDeletionSlot, keyblob::SecureDeletionData), Error> { in new_secret() 703 _slot: keyblob::SecureDeletionSlot, in get_secret() 704 ) -> Result<keyblob::SecureDeletionData, Error> { in get_secret() 707 fn delete_secret(&mut self, _slot: keyblob::SecureDeletionSlot) -> Result<(), Error> { in delete_secret()
|
/system/keymint/tests/ |
D | Android.bp | 66 srcs: ["src/bin/auth-keyblob-parse.rs"], 78 srcs: ["src/bin/encrypted-keyblob-parse.rs"],
|
/system/keymint/common/fuzz/fuzz_targets/ |
D | keyblob.rs | 23 let _ = kmr_common::keyblob::EncryptedKeyBlob::new(data);
|
/system/keymint/common/src/ |
D | keyblob.rs | 139 fn is_legacy_key(&self, keyblob: &[u8], params: &[KeyParam], root_of_trust: &BootInfo) -> bool { in is_legacy_key() 144 keyblob, in is_legacy_key() 166 keyblob: &[u8], in convert_legacy_key() 173 fn delete_legacy_key(&mut self, keyblob: &[u8]) -> Result<(), Error>; in delete_legacy_key()
|
D | lib.rs | 31 pub mod keyblob; module
|
/system/keymint/common/ |
D | Android.bp | 111 srcs: ["fuzz/fuzz_targets/keyblob.rs"],
|
/system/keymint/tests/src/ |
D | lib.rs | 22 use kmr_common::{keyblob, keyblob::SlotPurpose}; 548 pub fn test_sdd_mgr<M: keyblob::SecureDeletionSecretManager, R: Rng>(mut sdd_mgr: M, mut rng: R) { in test_sdd_mgr()
|
/system/keymint/ |
D | README.md | 26 implementation. This includes metadata processing code, keyblob manipulation code, and also the 186 - [ ] Legacy keyblob format converter (optional).
|