From 17a926156035925b05aebdff4acde42a1a669e01 Mon Sep 17 00:00:00 2001 From: Rajesh Nyamagoud Date: Tue, 17 Oct 2023 16:15:05 +0000 Subject: The `INCLUDE_UNIQUE_ID` parameter is not strictly expected to be in key authorizations. Bug: 279721870 Test: atest keystore2_client_tests Change-Id: Ic5724cf7ea2b6ad6d1f80e34524af777e5e0ea49 --- keystore2/test_utils/key_generations.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'keystore2') diff --git a/keystore2/test_utils/key_generations.rs b/keystore2/test_utils/key_generations.rs index 0ffc32af..badc4806 100644 --- a/keystore2/test_utils/key_generations.rs +++ b/keystore2/test_utils/key_generations.rs @@ -420,6 +420,13 @@ pub fn check_key_authorizations( //Check allowed-expected-key-parameters are present in given key authorizations list. expected_params.iter().all(|key_param| { + // `INCLUDE_UNIQUE_ID` is not strictly expected to be in key authorizations but has been + // put there by some implementations so cope with that. + if key_param.tag == Tag::INCLUDE_UNIQUE_ID + && !authorizations.iter().any(|auth| auth.keyParameter.tag == key_param.tag) + { + return true; + } if ALLOWED_TAGS_IN_KEY_AUTHS.contains(&key_param.tag) { assert!( check_key_param(authorizations, key_param), -- cgit v1.2.3