Home
last modified time | relevance | path

Searched refs:expect (Results 1 – 25 of 36) sorted by relevance

12

/trusty/user/app/keymint/
Dkeys.rs274 .expect("should never happen, KM_KAK_SLOT_ID follows from_bytes_with_nul rules"); in kak()
302 use test::{expect, expect_eq, expect_ne, skip};
307 let kak = trusty_keys.kak().expect("Couldn't retrieve kak"); in kak_call_returns_key()
308 let kak = kmr_common::explicit!(kak).expect("kak should be an explicit key"); in kak_call_returns_key()
310 expect!(matches!(kak, crypto::aes::Key::Aes256(_)), "Should have received an AES 256 key"); in kak_call_returns_key()
325 let kak = trusty_keys.kak().expect("Couldn't retrieve kak"); in kak_two_calls_returns_same_key()
326 let kak1 = match kmr_common::explicit!(kak).expect("kak should be an explicit key") { in kak_two_calls_returns_same_key()
330 let kak = trusty_keys.kak().expect("Couldn't retrieve kak"); in kak_two_calls_returns_same_key()
331 let kak2 = match kmr_common::explicit!(kak).expect("kak should be an explicit key") { in kak_two_calls_returns_same_key()
342 .root_kek(&trusty_keys.kek_context().expect("Couldn't get kek context")) in kek_call_returns_key()
[all …]
Dsecure_storage_manager.rs482 use test::{expect, expect_eq};
502 Session::new(Port::TamperProof, true).expect("Couldn't connect to storage"); in delete_key_file()
503 session.remove(&file_name).expect("Couldn't delete attestation file."); in delete_key_file()
508 Session::new(Port::TamperProof, true).expect("Couldn't connect to storage"); in check_key_file_exists()
515 Session::new(Port::TamperProof, true).expect("Couldn't connect to storage"); in delete_attestation_id_file()
516 session.remove(KM_ATTESTATION_ID_FILENAME).expect("Couldn't delete attestation IDs file."); in delete_attestation_id_file()
521 Session::new(Port::TamperProof, true).expect("Couldn't connect to storage"); in check_attestation_id_file_exists()
539 create_attestation_key_file(algorithm).expect("Couldn't create attestation key file"); in read_certificates_test()
553 let serialized_buffer = key_cert.write_to_bytes().expect("Couldn't serialize certs"); in read_certificates_test()
559 let certs = get_cert_chain(key_type).expect("Couldn't get certificates from storage"); in read_certificates_test()
[all …]
Dsecure_deletion_secret_manager.rs671 use test::{expect, expect_eq, expect_ne};
675 Session::new(Port::TamperProof, true).expect("Couldn't connect to storage"); in secret_manager_file_exists()
684 expect!(!secret_manager_file_exists(), "Couldn't delete secret manager file"); in secret_data_is_cached()
687 sdsf.get_or_create_factory_reset_secret(&mut rng).expect("Couldn't create secret"); in secret_data_is_cached()
694 sdsf.get_or_create_factory_reset_secret(&mut rng).expect("Couldn't get secret"); in secret_data_is_cached()
727 expect!(!secret_manager_file_exists(), "Couldn't delete secret manager file"); in secret_data_is_cached()
735 expect!(!secret_manager_file_exists(), "Couldn't delete secret manager file"); in new_secret_data_file_is_clean()
738 sdsf.get_or_create_factory_reset_secret(&mut rng).expect("Couldn't create secret"); in new_secret_data_file_is_clean()
742 sdsf.get_secret(SecureDeletionSlot(slot_num as u32)).expect("Couldn't read slot"); in new_secret_data_file_is_clean()
755 expect!(secret.is_err(), "Read outside of initial range should fail"); in new_secret_data_file_is_clean()
[all …]
Dmonotonic_clock.rs45 use test::{expect, expect_ne};
54 expect!(time1 <= time2, "Time should not decrement."); in get_milliseconds_since_boot_test()
55 expect!(time1 > 0, "time1 should be greater than 0"); in get_milliseconds_since_boot_test()
Dkeybox.rs39 CStr::from_bytes_with_nul(KEYBOX_PORT).expect("KEYBOX_PORT was not null terminated"); in new()
69 use test::{expect, expect_eq, skip};
93 expect!(result.is_ok(), "Failed to unwrap data: {:?}", result); in unwrap_fake_keybox_data()
94 let unwrapped_data = result.expect("Couldn't unwrap data"); in unwrap_fake_keybox_data()
Dipc_manager.rs634 use test::{expect, skip};
668 .expect("Keymint unit test app should be able to connect to the KM secure service"); in test_access_policy()
680 .expect("Couldn't retrieve error code"); in check_response_status()
766 .expect("couldn't construct SetAttestatonKey request"); in set_attestation_keys_certs()
771 let response: KMMessage = session.recv(buf).expect("Didn't get response"); in set_attestation_keys_certs()
773 expect!(km_error_code.is_ok(), "Should be able to call SetAttestatonKeys"); in set_attestation_keys_certs()
799 .expect("couldn't construct SetAttestatonIds request"); in set_attestation_ids_secure()
838 .expect("couldn't construct SetAttestatonIds request"); in set_attestation_ids()
844 let response: KMMessage = session.recv(buf).expect("Didn't get response"); in set_attestation_ids()
846 expect!(km_error_code.is_ok(), "Should be able to call SetAttestationIds"); in set_attestation_ids()
[all …]
/trusty/user/base/lib/hwkey/rust/src/
Dtest.rs48 let hwkey_session = Hwkey::open().expect("could not open hwkey session"); in test_hwkey_derive_repeatable_versioned()
59 .expect("could not derive key"); in test_hwkey_derive_repeatable_versioned()
71 .expect("could not derive key"); in test_hwkey_derive_repeatable_versioned()
86 .expect("could not derive key"); in test_hwkey_derive_repeatable_versioned()
102 .expect("could not derive key"); in test_hwkey_derive_repeatable_versioned()
122 let hwkey_session = Hwkey::open().expect("could not open hwkey session"); in test_hwkey_derive_different_default()
129 .expect("could not derive key"); in test_hwkey_derive_different_default()
135 let _ = hwkey_session.derive_key_req().derive(SRC_DATA2, buf2).expect("could not derive key"); in test_hwkey_derive_different_default()
148 let hwkey_session = Hwkey::open().expect("could not open hwkey session"); in test_hwkey_derive_different_specified()
159 .expect("could not derive key"); in test_hwkey_derive_different_specified()
[all …]
/trusty/user/app/sample/hwcryptokey-test/
Dversioned_keys_explicit.rs29 use test::{expect, assert_ok};
68 CString::try_new(RUST_DEVICE_KEY_SERVICE_PORT).expect("Failed to allocate port name"); in connect()
80 let hw_device_key = connect().expect("couldn't connect to HW Crypto service"); in generate_new_policy_and_clear_key()
93 expect!(derivation_key1.is_some(), "should have received a key"); in generate_new_policy_and_clear_key()
94 expect!(dice_policy.len() > 0, "should have received a DICE policy"); in generate_new_policy_and_clear_key()
121 expect!(derivation_key2.is_some(), "should have received a key"); in generate_new_policy_and_clear_key()
122 expect!(dice_policy_current, "policy should have been current"); in generate_new_policy_and_clear_key()
177 let hw_device_key = connect().expect("couldn't connect to HW Crypto service"); in old_dice_generates_old_clear_key_and_new_policy()
192 expect!(!dice_policy_current, "policy not expected to be current"); in old_dice_generates_old_clear_key_and_new_policy()
217 let hw_device_key = connect().expect("couldn't connect to HW Crypto service"); in dice_updates_are_unique()
[all …]
/trusty/user/app/secretkeeper/
Dtests.rs22 use test::{expect, skip};
33 expect!(result.is_ok(), "failed to connect to secure {port_name}: {result:?}"); in port_connect()
35 expect!( in port_connect()
70 expect!(matches!(rsp, bl::Response::IdentityKey(_))); in bootloader_retrieve_key()
73 expect!(coset::CoseKey::from_slice(&key).is_ok()); in bootloader_retrieve_key()
/trusty/user/base/lib/hwbcc/rust/src/
Dtest.rs69 get_dice_artifacts(0, dice_artifacts_buf).expect("could not get protected data"); in test_get_dice_artifacts()
90 SystemState::try_connect().expect("could not connect to system state service"); in test_get_dice_artifacts()
99 ns_deprivilege().expect("could not execute ns deprivilege"); in test_ns_deprivilege()
110 let bcc = get_bcc(HwBccMode::Test, &mut bcc_buf).expect("could not get bcc"); in test_get_bcc_test_mode()
132 let bcc = get_bcc(HwBccMode::Test, &mut bcc_buf).expect("could not get bcc"); in test_get_bcc_test_mode()
171 let bcc = get_bcc(HwBccMode::Release, &mut bcc_buf).expect("could not get bcc"); in test_get_bcc()
205 .expect("could not sign data"); in test_sign_data_test_mode()
222 .expect("could not sign data"); in test_sign_data()
/trusty/user/base/lib/hwwsk/rust/src/
Dtest.rs28 let port = CStr::from_bytes_with_nul(HWWSK_PORT).expect("HWKEY_PORT was not null terminated"); in open_hwwsk_session()
37 let session = open_hwwsk_session().expect("could not open hwkey session"); in test_hwwsk_generate_key()
49 let session = open_hwwsk_session().expect("could not open hwkey session"); in test_hwwsk_import_key()
/trusty/user/app/sample/hwwsk/
Dmain.rs64 .expect("Could not create port config") in main()
74 .expect("Could not create service manager") in main()
76 .expect("Hwwsk service quit unexpectedly"); in main()
/trusty/user/app/sample/hwcryptohal/server/
Dhwcrypto_device_key.rs376 use test::{assert_ok, expect};
389 expect!(key.is_some(), "should have received a key"); in derived_dice_bound_keys()
390 expect!(policy.len() > 0, "should have received a DICE policy"); in derived_dice_bound_keys()
395 expect!(key.is_some(), "should have received a key"); in derived_dice_bound_keys()
396 expect!(current_policy, "policy should have been current"); in derived_dice_bound_keys()
403 expect!(key.is_some(), "should have received a key"); in derived_dice_bound_keys()
404 expect!(policy.len() > 0, "should have received a DICE policy"); in derived_dice_bound_keys()
409 expect!(key.is_some(), "should have received a key"); in derived_dice_bound_keys()
410 expect!(current_policy, "policy should have been current"); in derived_dice_bound_keys()
424 expect!(key.is_some(), "should have received a key"); in derived_clear_key()
[all …]
Dhwcrypto_ipc_server.rs34 let cfg = PortCfg::new(RUST_SERVICE_PORT.to_str().expect("should not happen, valid utf-8")) in main_loop()
65 RpcSession::new().setup_trusty_client(RUST_SERVICE_PORT).expect("Failed to connect"); in connect_server()
Dservice_encryption_key.rs232 raw_key.try_into().expect("should not fail, call with SERVICE_KEK_LENGTH returns 32 bytes"), in derive_key_hkdf()
262 Ok(value_bytes.as_slice().try_into().expect("Shouldn't fail, we checked size already"))
291 use test::{expect, expect_eq};
296 expect!(header.is_ok(), "couldn't generate header"); in header_encryption_decryption()
302 expect!(encrypted_content.is_ok(), "couldn't generate header"); in header_encryption_decryption()
308 expect!(decrypted_data.is_ok(), "couldn't generate header"); in header_encryption_decryption()
Dplatform_functions.rs39 .expect("shouldn't happen, function never fails on BoringSSL"); in fill_bytes()
/trusty/user/app/sample/skel_rust/
Dmain.rs45 let state = SystemState::try_connect().expect("Could not connect to system state service"); in main()
49 .expect("Could not get provisioning flag"); in main()
/trusty/user/app/secretkeeper/app/
Dmain.rs22 secretkeeper::inner_main().expect("Secretkeeper service quit unexpectedly"); in main()
/trusty/user/app/sample/rust-hello-world/app/
Dmain.rs24 hello_world_in_rust::init_and_start_loop().expect("Rust Hello World service quit unexpectedly"); in main()
/trusty/user/app/sample/hwcryptohal/server/app/
Dmain.rs24 hwcrypto_ipc_server::main_loop().expect("main loop failed, should never happen"); in main()
/trusty/user/base/lib/tipc/rust/src/service/
Dhandle_set.rs98 .expect("No empty slot found, shouldn't happen because we checked at_max_connections") in add_connection()
126 .expect("Could not find connection") in close()
145 self.do_set_ctrl(sys::HSET_MOD as u32, 0, &port).expect("Failed to mask port"); in mask_all_ports()
152 .expect("Failed to unmask port"); in unmask_all_ports()
/trusty/user/base/lib/tipc/rust/src/
Dservice.rs1037 .expect("This is impossible. Array size must match expected PORT_COUNT"); in new_with_dispatcher()
1196 use test::{expect, expect_eq};
1300 expect!(channel.is_ok(), "create ports"); in port_create()
1314 expect!(channel.is_ok(), "create ports"); in port_create()
1343 expect!(channel.is_ok(), "create ports"); in wait_on_port()
1480 dispatcher.add_service(Rc::new(Service1), cfg).expect("Could not add service 1"); in multiple_services()
1484 dispatcher.add_service(Rc::new(Service2), cfg).expect("Could not add service 2"); in multiple_services()
1488 dispatcher.add_service(Rc::new(Service3), cfg).expect("Could not add service 3"); in multiple_services()
1494 .expect("Could not add wrapped service 2"); in multiple_services()
1500 .expect("Could not add wrapped service 3"); in multiple_services()
[all …]
/trusty/user/base/lib/unittest-rust/src/
Dlib.rs264 log::set_logger(&LOGGER).expect("Could not set global logger"); in test_main_static_abort()
274 .expect("Could not create port config") in test_main_static_abort()
282 .expect("Could not create service manager") in test_main_static_abort()
284 .expect("Test event loop failed"); in test_main_static_abort()
/trusty/user/app/storage/test/storage-unittest-aidl/unittests/
Dmod.rs6 use test::{assert_ok, expect, fail};
136 expect!(filenames.is_empty(), "Found unexpected files: {:?}", filenames); in file_list()
174 expect!(missing.is_empty(), "Did not find the following expected files: {:?}", missing); in file_list()
175 expect!(extra.is_empty(), "Found the following unexpected files: {:?}", extra); in file_list()
/trusty/user/app/sample/rust-hello-world/
Dlib.rs201 use test::{expect, expect_eq};
230 expect!(response.is_ok(), "The message should be able to be sent."); in hello_world_test()
232 .expect("Not a valid UTF-8 string!") in hello_world_test()

12