Loading security/see/hwcrypto/aidl/vts/functional/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -53,9 +53,11 @@ rust_library { rust_test { name: "VtsAidlHwCryptoTests", srcs: ["hwcryptokey_tests.rs"], test_config: "AndroidKeyOperations.xml", require_root: true, defaults: [ "hw_crypto_hal_aidl_rust_defaults", "rdroidtest.defaults", ], rustlibs: [ "libhwcryptohal_vts_test", Loading @@ -69,9 +71,11 @@ rust_test { rust_test { name: "VtsAidlHwCryptoOperationsTests", srcs: ["hwcrypto_operations_tests.rs"], test_config: "AndroidTestOperations.xml", require_root: true, defaults: [ "hw_crypto_hal_aidl_rust_defaults", "rdroidtest.defaults", ], rustlibs: [ "libhwcryptohal_vts_test", Loading security/see/hwcrypto/aidl/vts/functional/AndroidKeyOperations.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2025 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <configuration description="Config for HwCrypto HAL operations VTS tests."> <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/> <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> <option name="push-file" key="VtsAidlHwCryptoTests" value="/data/local/tmp/VtsAidlHwCryptoTests" /> </target_preparer> <test class="com.android.tradefed.testtype.rust.RustBinaryTest" > <option name="test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsAidlHwCryptoTests" /> <!-- Rust tests are run in parallel by default. Run these ones single-threaded. --> <option name="native-test-flag" value="--test-threads=1" /> </test> </configuration> No newline at end of file security/see/hwcrypto/aidl/vts/functional/AndroidTestOperations.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2025 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <configuration description="Config for HwCrypto HAL device key VTS tests."> <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/> <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> <option name="push-file" key="VtsAidlHwCryptoOperationsTests" value="/data/local/tmp/VtsAidlHwCryptoOperationsTests" /> </target_preparer> <test class="com.android.tradefed.testtype.rust.RustBinaryTest" > <option name="test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsAidlHwCryptoOperationsTests" /> <!-- Rust tests are run in parallel by default. Run these ones single-threaded. --> <option name="native-test-flag" value="--test-threads=1" /> </test> </configuration> No newline at end of file security/see/hwcrypto/aidl/vts/functional/hwcrypto_operations_tests.rs +17 −7 Original line number Diff line number Diff line Loading @@ -27,8 +27,10 @@ use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::s KeyPolicy::KeyPolicy,CryptoOperation::CryptoOperation,CryptoOperationSet::CryptoOperationSet, OperationParameters::OperationParameters, PatternParameters::PatternParameters, }; use rdroidtest::{ignore_if, rdroidtest}; #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_connection() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading @@ -36,7 +38,8 @@ fn test_hwcrypto_key_operations_connection() { assert!(hw_crypto_operations.is_ok(), "Couldn't get back a hwcrypto operations binder object"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_simple_aes_test() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -123,7 +126,8 @@ fn test_hwcrypto_key_operations_simple_aes_test() { assert_eq!(decrypted_msg, "string to be encrypted", "couldn't retrieve original message"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_simple_hmac_test() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -183,7 +187,8 @@ fn test_hwcrypto_key_operations_simple_hmac_test() { assert_eq!(mac, mac2, "got a different mac"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_aes_simple_cbcs_test_non_block_multiple() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -280,7 +285,8 @@ fn test_hwcrypto_key_operations_aes_simple_cbcs_test_non_block_multiple() { ); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_aes_simple_all_encrypted_cbcs_test() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -402,7 +408,8 @@ fn test_hwcrypto_key_operations_aes_simple_all_encrypted_cbcs_test() { ); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn check_cbcs_wrong_key_types() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -473,7 +480,8 @@ fn check_cbcs_wrong_key_types() { assert!(process_result.is_err(), "Should not be able to use cbcs mode with this key type"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn aes_simple_cbcs_test() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -584,3 +592,5 @@ fn aes_simple_cbcs_test() { "couldn't retrieve original message" ); } rdroidtest::test_main!(); security/see/hwcrypto/aidl/vts/functional/hwcryptokey_tests.rs +15 −6 Original line number Diff line number Diff line Loading @@ -26,14 +26,17 @@ use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::s }; use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::KeyPolicy::KeyPolicy; use hwcryptohal_common; use rdroidtest::{ignore_if, rdroidtest}; #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_connection() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey(); assert!(hw_crypto_key.is_ok(), "Couldn't get back a hwcryptokey binder object"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_get_current_dice_policy() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading @@ -41,7 +44,8 @@ fn test_hwcrypto_key_get_current_dice_policy() { assert!(!dice_policy.is_empty(), "received empty dice policy"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_get_keyslot_data() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading @@ -55,7 +59,8 @@ fn test_hwcrypto_get_keyslot_data() { ); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_import_clear_key() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -83,7 +88,8 @@ fn test_hwcrypto_import_clear_key() { assert!(key.is_err(), "imported keys should be of type PORTABLE"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_token_export_import() { // This test is not representative of the complete flow because here the exporter and importer // are the same client, which is not something we would usually do Loading @@ -107,7 +113,8 @@ fn test_hwcrypto_token_export_import() { // TODO: Use operations to verify that the keys match } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_android_invalid_calls() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -163,3 +170,5 @@ fn test_hwcrypto_android_invalid_calls() { "wrong error type received" ); } rdroidtest::test_main!(); Loading
security/see/hwcrypto/aidl/vts/functional/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -53,9 +53,11 @@ rust_library { rust_test { name: "VtsAidlHwCryptoTests", srcs: ["hwcryptokey_tests.rs"], test_config: "AndroidKeyOperations.xml", require_root: true, defaults: [ "hw_crypto_hal_aidl_rust_defaults", "rdroidtest.defaults", ], rustlibs: [ "libhwcryptohal_vts_test", Loading @@ -69,9 +71,11 @@ rust_test { rust_test { name: "VtsAidlHwCryptoOperationsTests", srcs: ["hwcrypto_operations_tests.rs"], test_config: "AndroidTestOperations.xml", require_root: true, defaults: [ "hw_crypto_hal_aidl_rust_defaults", "rdroidtest.defaults", ], rustlibs: [ "libhwcryptohal_vts_test", Loading
security/see/hwcrypto/aidl/vts/functional/AndroidKeyOperations.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2025 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <configuration description="Config for HwCrypto HAL operations VTS tests."> <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/> <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> <option name="push-file" key="VtsAidlHwCryptoTests" value="/data/local/tmp/VtsAidlHwCryptoTests" /> </target_preparer> <test class="com.android.tradefed.testtype.rust.RustBinaryTest" > <option name="test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsAidlHwCryptoTests" /> <!-- Rust tests are run in parallel by default. Run these ones single-threaded. --> <option name="native-test-flag" value="--test-threads=1" /> </test> </configuration> No newline at end of file
security/see/hwcrypto/aidl/vts/functional/AndroidTestOperations.xml 0 → 100644 +30 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2025 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <configuration description="Config for HwCrypto HAL device key VTS tests."> <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/> <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> <option name="push-file" key="VtsAidlHwCryptoOperationsTests" value="/data/local/tmp/VtsAidlHwCryptoOperationsTests" /> </target_preparer> <test class="com.android.tradefed.testtype.rust.RustBinaryTest" > <option name="test-device-path" value="/data/local/tmp" /> <option name="module-name" value="VtsAidlHwCryptoOperationsTests" /> <!-- Rust tests are run in parallel by default. Run these ones single-threaded. --> <option name="native-test-flag" value="--test-threads=1" /> </test> </configuration> No newline at end of file
security/see/hwcrypto/aidl/vts/functional/hwcrypto_operations_tests.rs +17 −7 Original line number Diff line number Diff line Loading @@ -27,8 +27,10 @@ use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::s KeyPolicy::KeyPolicy,CryptoOperation::CryptoOperation,CryptoOperationSet::CryptoOperationSet, OperationParameters::OperationParameters, PatternParameters::PatternParameters, }; use rdroidtest::{ignore_if, rdroidtest}; #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_connection() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading @@ -36,7 +38,8 @@ fn test_hwcrypto_key_operations_connection() { assert!(hw_crypto_operations.is_ok(), "Couldn't get back a hwcrypto operations binder object"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_simple_aes_test() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -123,7 +126,8 @@ fn test_hwcrypto_key_operations_simple_aes_test() { assert_eq!(decrypted_msg, "string to be encrypted", "couldn't retrieve original message"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_simple_hmac_test() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -183,7 +187,8 @@ fn test_hwcrypto_key_operations_simple_hmac_test() { assert_eq!(mac, mac2, "got a different mac"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_aes_simple_cbcs_test_non_block_multiple() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -280,7 +285,8 @@ fn test_hwcrypto_key_operations_aes_simple_cbcs_test_non_block_multiple() { ); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_operations_aes_simple_all_encrypted_cbcs_test() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -402,7 +408,8 @@ fn test_hwcrypto_key_operations_aes_simple_all_encrypted_cbcs_test() { ); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn check_cbcs_wrong_key_types() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -473,7 +480,8 @@ fn check_cbcs_wrong_key_types() { assert!(process_result.is_err(), "Should not be able to use cbcs mode with this key type"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn aes_simple_cbcs_test() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -584,3 +592,5 @@ fn aes_simple_cbcs_test() { "couldn't retrieve original message" ); } rdroidtest::test_main!();
security/see/hwcrypto/aidl/vts/functional/hwcryptokey_tests.rs +15 −6 Original line number Diff line number Diff line Loading @@ -26,14 +26,17 @@ use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::s }; use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::KeyPolicy::KeyPolicy; use hwcryptohal_common; use rdroidtest::{ignore_if, rdroidtest}; #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_connection() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey(); assert!(hw_crypto_key.is_ok(), "Couldn't get back a hwcryptokey binder object"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_key_get_current_dice_policy() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading @@ -41,7 +44,8 @@ fn test_hwcrypto_key_get_current_dice_policy() { assert!(!dice_policy.is_empty(), "received empty dice policy"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_get_keyslot_data() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading @@ -55,7 +59,8 @@ fn test_hwcrypto_get_keyslot_data() { ); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_import_clear_key() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -83,7 +88,8 @@ fn test_hwcrypto_import_clear_key() { assert!(key.is_err(), "imported keys should be of type PORTABLE"); } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_token_export_import() { // This test is not representative of the complete flow because here the exporter and importer // are the same client, which is not something we would usually do Loading @@ -107,7 +113,8 @@ fn test_hwcrypto_token_export_import() { // TODO: Use operations to verify that the keys match } #[test] #[rdroidtest] #[ignore_if(hwcryptohal_vts_test::ignore_test())] fn test_hwcrypto_android_invalid_calls() { let hw_crypto_key = hwcryptohal_vts_test::get_hwcryptokey() .expect("Couldn't get back a hwcryptokey binder object"); Loading Loading @@ -163,3 +170,5 @@ fn test_hwcrypto_android_invalid_calls() { "wrong error type received" ); } rdroidtest::test_main!();