summaryrefslogtreecommitdiff
path: root/keystore2
diff options
context:
space:
mode:
authorRajesh Nyamagoud <nyamagoud@google.com>2023-10-17 16:15:05 +0000
committerRajesh Nyamagoud <nyamagoud@google.com>2023-10-19 17:29:12 +0000
commit17a926156035925b05aebdff4acde42a1a669e01 (patch)
tree3fcfd017e8c26b36abc44a15cf7a363703465df1 /keystore2
parente79fe80acff1b0b9c7f63032191923f5b0aaec6b (diff)
downloadsecurity-17a926156035925b05aebdff4acde42a1a669e01.tar.gz
The `INCLUDE_UNIQUE_ID` parameter is not strictly expected to be in key authorizations.
Bug: 279721870 Test: atest keystore2_client_tests Change-Id: Ic5724cf7ea2b6ad6d1f80e34524af777e5e0ea49
Diffstat (limited to 'keystore2')
-rw-r--r--keystore2/test_utils/key_generations.rs7
1 files changed, 7 insertions, 0 deletions
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),