Merge "Skip running the test using `MAX_USES_PER_BOOT` on devices with keymaster implementation." into main am: e6dfda04d2 am: 1e7606d1a1
Original change: https://android-review.googlesource.com/c/platform/system/security/+/3338294
Change-Id: Idc375f33dae7d0674c2fc919de07ccf379ba191c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/keystore2/tests/keystore2_client_authorizations_tests.rs b/keystore2/tests/keystore2_client_authorizations_tests.rs
index bd9dab9..504e6ab 100644
--- a/keystore2/tests/keystore2_client_authorizations_tests.rs
+++ b/keystore2/tests/keystore2_client_authorizations_tests.rs
@@ -472,6 +472,13 @@
#[test]
fn keystore2_gen_key_auth_max_uses_per_boot() {
let sl = SecLevel::tee();
+ if sl.is_keymaster() {
+ // Older devices with Keymaster implementation may use the key during generateKey to export
+ // the generated public key (EC Key), leading to an unnecessary increment of the
+ // key-associated counter. This can cause the test to fail, so skipping this test on older
+ // devices to avoid test failure.
+ return;
+ }
const MAX_USES_COUNT: i32 = 3;
let gen_params = authorizations::AuthSetBuilder::new()