/base/security/asset/test/unittest/module_test/src/crypto_manager/ |
H A D | lib.rs | 67 let calling_info = CallingInfo::new(0, OwnerType::Native, vec![b'2']); in generate_and_delete() 69 SecretKey::new_without_alias(&calling_info, AuthType::None, Accessibility::DevicePowerOn, false).unwrap(); in generate_and_delete() 72 let _ = SecretKey::delete_by_owner(&calling_info); in generate_and_delete() 80 let calling_info = CallingInfo::new(0, OwnerType::Native, vec![b'2']); in encrypt_and_decrypt() 82 SecretKey::new_without_alias(&calling_info, AuthType::None, Accessibility::DevicePowerOn, false).unwrap(); in encrypt_and_decrypt() 102 let calling_info = CallingInfo::new(0, OwnerType::Native, vec![b'2']); in crypto_init() 104 SecretKey::new_without_alias(&calling_info, AuthType::Any, Accessibility::DevicePowerOn, false).unwrap(); in crypto_init() 107 let mut crypto = Crypto::build(secret_key.clone(), calling_info, 600).unwrap(); in crypto_init() 115 let calling_info = CallingInfo::new(0, OwnerType::Native, vec![b'2']); in crypto_exec() 117 SecretKey::new_without_alias(&calling_info, AuthTyp in crypto_exec() [all...] |
/base/security/asset/services/db_operator/src/test/ |
H A D | test_database.rs | 64 let calling_info = CallingInfo::new_self(); in open_db_and_insert_data() 66 Database::build(calling_info.user_id(), calling_info.owner_type_enum(), calling_info.owner_info(), false) in open_db_and_insert_data() 88 let calling_info = CallingInfo::new_self(); in create_and_drop_database() 90 Database::build(calling_info.user_id(), calling_info.owner_type_enum(), calling_info.owner_info(), false) in create_and_drop_database() 100 let calling_info = CallingInfo::new_self(); in database_version() 101 let db = Database::build(calling_info in database_version() [all...] |
H A D | test_table.rs | 35 let calling_info = CallingInfo::new_self(); in create_delete_table() 37 Database::build(calling_info.user_id(), calling_info.owner_type_enum(), calling_info.owner_info(), false) in create_delete_table() 51 let calling_info = CallingInfo::new_self(); in table_restore() 53 Database::build(calling_info.user_id(), calling_info.owner_type_enum(), calling_info.owner_info(), false) in table_restore() 85 let calling_info = CallingInfo::new_self(); in insert_test_data() 86 let db = Database::build(calling_info in insert_test_data() [all...] |
/base/security/asset/services/crypto_manager/src/ |
H A D | crypto_manager.rs | 58 pub fn find(&mut self, calling_info: &CallingInfo, challenge: &Vec<u8>) -> Result<&Crypto> { in find() 61 if crypto.challenge().eq(challenge) && crypto.calling_info().eq(calling_info) { in find() 69 pub fn remove(&mut self, calling_info: &CallingInfo, challenge: &Vec<u8>) { in remove() 70 self.cryptos.retain(|crypto| crypto.calling_info() != calling_info || !crypto.challenge().eq(challenge)); in remove() 74 pub fn remove_by_calling_info(&mut self, calling_info: &CallingInfo) { in remove_by_calling_info() 75 self.cryptos.retain(|crypto| crypto.calling_info() != calling_info); in remove_by_calling_info()
|
H A D | secret_key.rs | 66 calling_info: &CallingInfo, in calculate_key_alias() 73 alias.extend_from_slice(&calling_info.user_id().to_le_bytes()); in calculate_key_alias() 75 alias.extend_from_slice(&calling_info.owner_type().to_le_bytes()); in calculate_key_alias() 77 alias.extend(calling_info.owner_info()); in calculate_key_alias() 85 calling_info: &CallingInfo, in get_existing_key_alias() 90 let new_alias = calculate_key_alias(calling_info, auth_type, access_type, require_password_set, true); in get_existing_key_alias() 93 user_id: calling_info.user_id(), in get_existing_key_alias() 105 user_id: calling_info.user_id(), in get_existing_key_alias() 116 let old_alias = calculate_key_alias(calling_info, auth_type, access_type, require_password_set, false); in get_existing_key_alias() 118 user_id: calling_info in get_existing_key_alias() [all...] |
H A D | crypto.rs | 47 calling_info: CallingInfo, 56 pub fn build(key: SecretKey, calling_info: CallingInfo, valid_time: u32) -> Result<Self> { in build() 59 calling_info, in build() 170 pub(crate) fn calling_info(&self) -> &CallingInfo { 171 &self.calling_info
|
/base/security/asset/services/core_service/src/operations/ |
H A D | operation_add.rs | 35 fn encrypt_secret(calling_info: &CallingInfo, db_data: &mut DbMap) -> Result<()> { in encrypt_secret() 36 let secret_key = common::build_secret_key(calling_info, db_data)?; in encrypt_secret() 71 fn get_query_condition(calling_info: &CallingInfo, attrs: &AssetMap) -> Result<DbMap> { in get_query_condition() 75 query.insert(column::OWNER, Value::Bytes(calling_info.owner_info().clone())); in get_query_condition() 76 query.insert(column::OWNER_TYPE, Value::Number(calling_info.owner_type())); in get_query_condition() 103 fn check_accessibity_validity(attributes: &AssetMap, calling_info: &CallingInfo) -> Result<()> { in check_accessibity_validity() 104 if calling_info.user_id() > SYSTEM_USER_ID_MAX { in check_accessibity_validity() 132 fn check_arguments(attributes: &AssetMap, calling_info: &CallingInfo) -> Result<()> { in check_arguments() 143 check_accessibity_validity(attributes, calling_info)?; in check_arguments() 148 fn local_add(attributes: &AssetMap, calling_info [all...] |
H A D | operation_query.rs | 42 fn upgrade_version(db: &mut Database, calling_info: &CallingInfo, db_data: &mut DbMap) -> Result<()> { in upgrade_version() 45 let secret_key = common::build_secret_key(calling_info, db_data)?; in upgrade_version() 62 fn decrypt_secret(calling_info: &CallingInfo, db_data: &mut DbMap) -> Result<()> { in decrypt_secret() 64 let secret_key = common::build_secret_key(calling_info, db_data)?; in decrypt_secret() 70 fn exec_crypto(calling_info: &CallingInfo, query: &AssetMap, db_data: &mut DbMap) -> Result<()> { in exec_crypto() 78 match manager.find(calling_info, challenge) { in exec_crypto() 88 fn query_all(calling_info: &CallingInfo, db_data: &mut DbMap, query: &AssetMap) -> Result<Vec<AssetMap>> { in query_all() 89 let mut db = create_db_instance(query, calling_info)?; in query_all() 96 exec_crypto(calling_info, query, &mut results[0])?; in query_all() 98 _ => decrypt_secret(calling_info, in query_all() [all...] |
H A D | operation_pre_query.rs | 50 fn query_key_attrs(calling_info: &CallingInfo, db_data: &DbMap, attrs: &AssetMap) -> Result<(Accessibility, bool)> { in query_key_attrs() 51 let mut db = create_db_instance(attrs, calling_info)?; in query_key_attrs() 67 pub(crate) fn pre_query(calling_info: &CallingInfo, query: &AssetMap) -> Result<Vec<u8>> { 71 common::add_owner_info(calling_info, &mut db_data); 74 let (access_type, require_password_set) = query_key_attrs(calling_info, &db_data, query)?; 79 let secret_key = SecretKey::new_without_alias(calling_info, AuthType::Any, access_type, require_password_set)?; 80 let mut crypto = Crypto::build(secret_key, calling_info.clone(), valid_time)?;
|
H A D | operation_update.rs | 29 fn encrypt(calling_info: &CallingInfo, db_data: &DbMap) -> Result<Vec<u8>> { in encrypt() 30 let secret_key = common::build_secret_key(calling_info, db_data)?; in encrypt() 96 pub(crate) fn update(calling_info: &CallingInfo, query: &AssetMap, update: &AssetMap) -> Result<()> { 100 common::add_owner_info(calling_info, &mut query_db_data); 106 let mut db = create_db_instance(query, calling_info)?; 128 let cipher = encrypt(calling_info, result)?; 138 common::inform_asset_ext(calling_info, update);
|
H A D | operation_remove.rs | 50 pub(crate) fn remove(calling_info: &CallingInfo, query: &AssetMap) -> Result<()> { 54 common::add_owner_info(calling_info, &mut db_data); 60 let mut db = create_db_instance(query, calling_info)?; 76 common::inform_asset_ext(calling_info, query);
|
H A D | operation_post_query.rs | 36 pub(crate) fn post_query(calling_info: &CallingInfo, handle: &AssetMap) -> Result<()> { 41 crypto_manager.lock().unwrap().remove(calling_info, challenge);
|
/base/security/asset/services/core_service/src/ |
H A D | lib.rs | 70 let calling_info = CallingInfo::new_self(); in on_start_with_reason() 72 let _ = upload_system_event(start_service(handler), &calling_info, start, func_name); in on_start_with_reason() 124 .init(Box::new(AssetContext { user_id: 0, calling_info: CallingInfo::new(0, OwnerType::Hap, vec![]) })); in start_service() 157 ($func:path, $calling_info:expr, $($args:expr),+) => {{ 162 create_user_de_dir($calling_info.user_id())?; 163 upload_system_event($func($calling_info, $($args),+), $calling_info, start, func_name) 172 fn add(&self, calling_info: &CallingInfo, attributes: &AssetMap) -> Result<()> { in add() 173 execute!(operations::add, calling_info, attributes) in add() 176 fn remove(&self, calling_info [all...] |
/base/security/asset/services/core_service/src/common_event/ |
H A D | listener.rs | 55 fn remove_db(file_path: &str, calling_info: &CallingInfo, is_ce: bool) -> Result<()> { in remove_db() 56 let db_name = construct_splited_db_name(calling_info.owner_type_enum(), calling_info.owner_info(), is_ce)?; in remove_db() 75 calling_info: &CallingInfo, in delete_in_de_db_on_package_removed() 82 Database::build(calling_info.user_id(), calling_info.owner_type_enum(), calling_info.owner_info(), false)?; in delete_in_de_db_on_package_removed() 87 remove_db(&format!("{}/{}", DE_ROOT_PATH, calling_info.user_id()), calling_info, false)?; in delete_in_de_db_on_package_removed() 93 calling_info in delete_in_ce_db_on_package_removed() [all...] |
/base/security/asset/services/common/src/ |
H A D | calling_info.rs | 107 let calling_info = CallingInfo::build(Some(Value::Number(specific_user_id)), &process_info); in test_build_callig_info_specific_and_hap() 108 assert_eq!(calling_info.user_id(), specific_user_id as i32); in test_build_callig_info_specific_and_hap() 111 assert_eq!(calling_info.owner_info(), &owner_info); in test_build_callig_info_specific_and_hap() 127 let calling_info = CallingInfo::build(None, &process_info); in test_build_callig_info_hap() 128 assert_eq!(calling_info.user_id(), user_id as i32); in test_build_callig_info_hap() 130 assert_eq!(calling_info.owner_info(), &owner_info); in test_build_callig_info_hap() 145 let calling_info = CallingInfo::build(None, &process_info); in test_build_callig_info_native() 146 assert_eq!(calling_info.user_id(), user_id as i32); in test_build_callig_info_native() 148 assert_eq!(calling_info.owner_info(), &owner_info); in test_build_callig_info_native() 164 let calling_info in test_build_callig_info_specific_and_native() [all...] |
H A D | lib.rs | 19 mod calling_info; modules 22 pub use calling_info::CallingInfo;
|
/base/security/asset/services/plugin/src/ |
H A D | asset_plugin.rs | 111 pub calling_info: CallingInfo,
|