Home
last modified time | relevance | path

Searched refs:unwrap (Results 1 – 25 of 26) sorted by relevance

12

/trusty/user/base/lib/storage/rust/src/
Dtest.rs7 let session = Session::new(Port::TamperDetectEarlyAccess, true).unwrap(); in connect()
15 let session = Session::new(Port::TamperDetectEarlyAccess, false).unwrap(); in connect_no_wait()
31 let mut session = Session::new(Port::TamperDetectEarlyAccess, true).unwrap(); in read_write()
37 session.write(file_name, file_contents.as_bytes()).unwrap(); in read_write()
41 let data = session.read(file_name, data).unwrap(); in read_write()
52 let mut session = Session::new(Port::TamperDetectEarlyAccess, true).unwrap(); in read_all_buf_too_small()
58 session.write(file_name, file_contents.as_bytes()).unwrap(); in read_all_buf_too_small()
72 let mut session = Session::new(Port::TamperDetectEarlyAccess, true).unwrap(); in read_at()
78 session.write(file_name, file_contents).unwrap(); in read_at()
80 let mut file = session.open_file(file_name, OpenMode::Open).unwrap(); in read_at()
[all …]
Dlib.rs207 Ok(Self { raw: handle.try_into().unwrap() }) in new()
385 offset.try_into().unwrap(), in read_at()
463 offset.try_into().unwrap(), in write_at_impl()
/trusty/user/app/secretkeeper/
Dtests.rs29 let port = CString::try_new(port_name).unwrap(); in port_connect()
59 let port = CString::try_new(BL_PORT_NAME).unwrap(); in bootloader_retrieve_key()
60 let session = Handle::connect(port.as_c_str()).unwrap(); in bootloader_retrieve_key()
65 session.send(&req).unwrap(); in bootloader_retrieve_key()
67 let rsp: SkMessage = session.recv(&mut buf).unwrap(); in bootloader_retrieve_key()
69 let rsp = bl::Response::from_slice(&rsp.0).unwrap(); in bootloader_retrieve_key()
Dstore.rs149 store.delete(KEY1).unwrap(); in test_secretkeeper_store()
150 store.delete(KEY2).unwrap(); in test_secretkeeper_store()
152 store.store(KEY1, SECRET1).unwrap(); in test_secretkeeper_store()
155 store.store(KEY1, SECRET2).unwrap(); in test_secretkeeper_store()
158 store.store(KEY1, SECRET1).unwrap(); in test_secretkeeper_store()
161 store.store(KEY2, SECRET1).unwrap(); in test_secretkeeper_store()
164 store.delete(KEY1).unwrap(); in test_secretkeeper_store()
167 store.delete(KEY2).unwrap(); in test_secretkeeper_store()
172 store.delete(KEY1).unwrap(); in test_secretkeeper_store()
173 store.delete(KEY2).unwrap(); in test_secretkeeper_store()
/trusty/user/app/sample/memref-test/rust/
Dmemref_test.rs21 let port = CStr::from_bytes_with_nul(LENDER_PORT).unwrap(); in recv_ref()
22 let lender = Handle::connect(port).unwrap(); in recv_ref()
43 let port = CStr::from_bytes_with_nul(LENDER_PORT).unwrap(); in drop_shared_buf_handle()
44 let lender = Handle::connect(port).unwrap(); in drop_shared_buf_handle()
66 .unwrap(); in request_remote_buf()
70 let resp = lender.recv::<MemrefResponse>(recv_buf).unwrap(); in request_remote_buf()
94 .unwrap(); in test_read_write()
97 let resp = lender.recv::<ReadResponse>(recv_buf).unwrap(); in test_read_write()
113 .unwrap(); in test_read_write()
116 lender.recv::<WriteResponse>(recv_buf).unwrap(); in test_read_write()
[all …]
/trusty/user/app/keymint/secure_storage_manager/
Dsoftware.rs365 key: KeyMaterial::Rsa(rsa::Key(hex_decode(RSA_ATTEST_KEY).unwrap()).into()), in new()
368 encoded_certificate: hex_decode(RSA_ATTEST_CERT).unwrap(), in new()
371 encoded_certificate: hex_decode(RSA_ATTEST_ROOT_CERT).unwrap(), in new()
379 ec::Key::P256(ec::NistKey(hex_decode(EC_ATTEST_KEY).unwrap())).into(), in new()
383 encoded_certificate: hex_decode(EC_ATTEST_CERT).unwrap(), in new()
386 encoded_certificate: hex_decode(EC_ATTEST_ROOT_CERT).unwrap(), in new()
/trusty/user/app/keymint/
Dkeys.rs132 let kdf_version = kdf_version.unwrap(); in new()
133 let os_rollback_version = os_rollback_version.unwrap(); in new()
378 let context1 = TrustyKekContext::from_raw(&context1.unwrap().to_raw().unwrap()).unwrap(); in kek_with_different_context_return_different_keys()
394 .unwrap(); in kek_with_different_context_return_different_keys()
415 .unwrap(); in legacy_kek_is_different_than_non_legacy()
416 let context2 = TrustyKekContext::new(false, None, None).unwrap(); in legacy_kek_is_different_than_non_legacy()
438 let num = deserialize_u32(&[0; 4], "").unwrap(); in deserializing_u32s()
440 let num = deserialize_u32(&[0xff; 4], "").unwrap(); in deserializing_u32s()
442 let num = deserialize_u32(&[1, 0, 0, 0], "").unwrap(); in deserializing_u32s()
444 let num = deserialize_u32(&[0x78, 0x56, 0x34, 0x12], "").unwrap(); in deserializing_u32s()
[all …]
Dipc_manager.rs650 let port1 = CString::try_new(KM_NS_TIPC_SRV_PORT).unwrap(); in connection_test()
651 let _session1 = Handle::connect(port1.as_c_str()).unwrap(); in connection_test()
652 let port2 = CString::try_new(KM_SEC_TIPC_SRV_PORT).unwrap(); in connection_test()
653 let _session2 = Handle::connect(port2.as_c_str()).unwrap(); in connection_test()
654 let port3 = CString::try_new(KM_NS_LEGACY_TIPC_SRV_PORT).unwrap(); in connection_test()
655 let _session3 = Handle::connect(port3.as_c_str()).unwrap(); in connection_test()
666 let port = CString::try_new(KM_SEC_TIPC_SRV_PORT).unwrap(); in test_access_policy()
762 let port = CString::try_new(KM_NS_LEGACY_TIPC_SRV_PORT).unwrap(); in set_attestation_keys_certs()
763 let session = Handle::connect(port.as_c_str()).unwrap(); in set_attestation_keys_certs()
769 session.send(&set_attestation_key_req).unwrap(); in set_attestation_keys_certs()
[all …]
Drng.rs29 openssl::rand::rand_bytes(dest).unwrap(); // safe: BoringSSL's RAND_bytes() never fails in fill_bytes()
Dkeymaster_attributes.rs75 self.uuid.as_mut().unwrap() in mut_uuid()
111 self.product_id.as_mut().unwrap() in mut_product_id()
303 self.brand.as_mut().unwrap() in mut_brand()
339 self.device.as_mut().unwrap() in mut_device()
375 self.product.as_mut().unwrap() in mut_product()
411 self.serial.as_mut().unwrap() in mut_serial()
447 self.imei.as_mut().unwrap() in mut_imei()
483 self.meid.as_mut().unwrap() in mut_meid()
519 self.manufacturer.as_mut().unwrap() in mut_manufacturer()
555 self.model.as_mut().unwrap() in mut_model()
[all …]
Dsecure_storage_manager.rs555 file.write_all(&serialized_buffer).unwrap(); in read_certificates_test()
577 file.write_all(&raw_protobuf).unwrap(); in read_certificates_test()
679 file.write_all(&raw_protobuf).unwrap(); in read_key_test()
865 file.write_all(&serialized_buffer).unwrap(); in single_attestation_id_field()
892 file.write_all(&raw_protobuf).unwrap(); in single_attestation_id_field()
1037 file.write_all(&serialized_buffer).unwrap(); in all_attestation_id_fields()
1077 file.write_all(&raw_protobuf).unwrap(); in all_attestation_id_fields()
1098 file.write_all(&raw_protobuf).unwrap(); in delete_attestation_ids_file()
/trusty/user/base/lib/hwkey/rust/src/
Dtest.rs476 let keyslot = CStr::from_bytes_with_nul(RPMB_STORAGE_AUTH_KEY_ID).unwrap(); in test_get_keyslot_storage_auth()
487 let keyslot = CStr::from_bytes_with_nul(HWCRYPTO_UNITTEST_KEYBOX_ID).unwrap(); in test_get_keybox()
500 let keyslot = CStr::from_bytes_with_nul(HWCRYPTO_UNITTEST_DERIVED_KEYBOX_ID).unwrap(); in test_get_derived_keybox()
513 let keyslot = CStr::from_bytes_with_nul(HWCRYPTO_UNITTEST_OPAQUE_HANDLE_ID).unwrap(); in test_get_opaque_handle()
531 let keyslot = CStr::from_bytes_with_nul(HWCRYPTO_UNITTEST_OPAQUE_HANDLE_ID).unwrap(); in test_get_opaque_key()
540 .get_keyslot_data(CStr::from_bytes_with_nul(opaque_handle).unwrap(), key_buf) in test_get_opaque_key()
557 let keyslot = CStr::from_bytes_with_nul(HWCRYPTO_UNITTEST_OPAQUE_HANDLE_ID).unwrap(); in test_get_multiple_opaque_keys()
565 CStr::from_bytes_with_nul(HWCRYPTO_UNITTEST_OPAQUE_HANDLE_NOACCESS_ID).unwrap(); in test_get_multiple_opaque_keys()
577 .get_keyslot_data(CStr::from_bytes_with_nul(handle).unwrap(), key_buf) in test_get_multiple_opaque_keys()
584 .get_keyslot_data(CStr::from_bytes_with_nul(no_access_handle).unwrap(), key_buf) in test_get_multiple_opaque_keys()
[all …]
/trusty/user/app/storage/test/storage-unittest-aidl/unittests/
Dhelpers.rs60 let mut pattern: u32 = (offset / U32_SIZE).try_into().unwrap(); in check_pattern32()
85 let mut pattern: u32 = (offset / U32_SIZE).try_into().unwrap(); in fill_pattern32()
116 .write(chunk_offset.try_into().unwrap(), &buf) in write_pattern()
118 if written != chunk_len.try_into().unwrap() { in write_pattern()
140 .read(chunk_len.try_into().unwrap(), chunk_offset.try_into().unwrap()) in read_pattern()
/trusty/user/app/sample/rust-hello-world/
Dlib.rs209 let port = CString::try_new(HELLO_TRUSTY_PORT_NAME).unwrap(); in connection_test()
210 let _session = Handle::connect(port.as_c_str()).unwrap(); in connection_test()
217 let port = CString::try_new(HELLO_TRUSTY_PORT_NAME).unwrap(); in hello_world_test()
218 let session = Handle::connect(port.as_c_str()).unwrap(); in hello_world_test()
223 length: inputstring.len().try_into().unwrap(), in hello_world_test()
226 session.send(&test_message).unwrap(); in hello_world_test()
/trusty/user/base/lib/tipc/rust/src/
Dservice.rs1245 Channel::try_new_port(&PortCfg::new_raw(CString::try_new(&path[..]).unwrap())).err(), in port_create_negative()
1252 let cfg = PortCfg::new(&path).unwrap().msg_queue_len(0); in port_create_negative()
1259 let cfg = PortCfg::new(&path).unwrap().msg_max_size(0); in port_create_negative()
1266 let cfg = PortCfg::new(&path).unwrap().msg_queue_len(MAX_PORT_BUF_NUM * 100); in port_create_negative()
1273 let cfg = PortCfg::new(&path).unwrap().msg_max_size(MAX_PORT_BUF_SIZE * 100); in port_create_negative()
1284 let cfg = PortCfg::new(&path).unwrap(); in port_create_negative()
1298 let cfg = PortCfg::new(path).unwrap(); in port_create()
1301 channels.try_push(channel.unwrap()).unwrap(); in port_create()
1312 let cfg = PortCfg::new(path).unwrap(); in port_create()
1315 channels.try_push(channel.unwrap()).unwrap(); in port_create()
[all …]
Dhandle.rs351 let page_size: usize = page_size.try_into().unwrap(); in mmap()
495 &crate::PortCfg::new("com.android.tipc.handle_probe").unwrap(), in first_free_handle_index()
497 .unwrap(); in first_free_handle_index()
/trusty/user/app/sample/hwcryptohal/common/
Derr.rs91 let msg = CString::new(format!("KM error {:?}", e).as_str()).unwrap(); in from()
98 .unwrap(); in from()
103 CString::new(format!("CBOR serialization error {:?}", e).as_str()).unwrap(); in from()
/trusty/user/app/sample/rust_no_std/
Dmain.rs31 Vec::<u8>::try_with_capacity(128).unwrap(); in start()
/trusty/user/app/keymint/unauthorized_test_app/
Dlib.rs33 let port2 = CString::try_new(KM_SEC_TIPC_SRV_PORT).unwrap(); in test_access_policy_unauthorized()
/trusty/user/app/sample/hwcryptohal/server/
Dservice_encryption_key.rs297 let header = header.unwrap(); in header_encryption_decryption()
303 let encrypted_content = encrypted_content.unwrap(); in header_encryption_decryption()
309 let (decrypted_header, decrypted_content) = decrypted_data.unwrap(); in header_encryption_decryption()
311 Value::from_slice(&decrypted_content[..]).unwrap().into_bytes().unwrap(); in header_encryption_decryption()
Dhwcrypto_device_key.rs381 Uuid::new_from_string("f41a7796-975a-4279-8cc4-b73f8820430d").unwrap(), in derived_dice_bound_keys()
416 Uuid::new_from_string("f41a7796-975a-4279-8cc4-b73f8820430d").unwrap(), in derived_clear_key()
/trusty/user/app/sample/hwcrypto/keybox/
Dsrv.c105 struct full_keybox_unwrap_req unwrap; member
122 rc = keybox_handle_unwrap(ctx->chan, &req.cmd_header.unwrap, in keybox_handle_msg()
/trusty/user/base/lib/trusty-log/src/
Dlib.rs137 LOGGER.as_ref().unwrap() in init_with_config()
/trusty/kernel/platform/generic-x86_64/rust/src/
Dlib.rs78 let nonnullptr = NonNull::new(ptr.wrapping_add(offset) as _).unwrap(); in map_physical_region()
/trusty/user/base/lib/hwbcc/rust/src/
Dtest.rs91 if system_state_session.get_flag(SystemStateFlag::AppLoadingUnlocked).unwrap() != 0 { in test_get_dice_artifacts()

12