From e9dcae53e41ca10a12a036d26dee86f47f668c8b Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Tue, 11 Jun 2024 15:36:20 +0100 Subject: [PATCH] KeyMint: version gate attestation of IMEI2 aosp/3106417 added extra tests with for device ID attestation, but didn't include a version gate for attesting to the second IMEI value, which is only present in KeyMint v3+. Test: VtsAidlKeyMintTargetTest Change-Id: I95f47942058781709efe96d38442e0518e39705d --- security/keymint/aidl/vts/functional/KeyMintTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp index 3c49a82ba6..527b5e07ea 100644 --- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp @@ -2059,7 +2059,7 @@ TEST_P(NewKeyGenerationTest, EcdsaAttestationIdTags) { extra_tags.Authorization(TAG_ATTESTATION_ID_IMEI, imei.data(), imei.size()); } string second_imei = get_imei(1); - if (!second_imei.empty()) { + if (!second_imei.empty() && isSecondImeiIdAttestationRequired()) { extra_tags.Authorization(TAG_ATTESTATION_ID_SECOND_IMEI, second_imei.data(), second_imei.size()); } @@ -2135,7 +2135,7 @@ TEST_P(NewKeyGenerationTest, EcdsaAttestationIdAllTags) { extra_tags.Authorization(TAG_ATTESTATION_ID_IMEI, imei.data(), imei.size()); } string second_imei = get_imei(1); - if (!second_imei.empty()) { + if (!second_imei.empty() && isSecondImeiIdAttestationRequired()) { extra_tags.Authorization(TAG_ATTESTATION_ID_SECOND_IMEI, second_imei.data(), second_imei.size()); }