From a9b3bb96b2ac5ae699ecce18357b6fa292806d8a Mon Sep 17 00:00:00 2001 From: Max Bires Date: Mon, 21 Nov 2022 23:02:09 -0800 Subject: [PATCH] Add VSR enforcement testing for IRPC versioning. Check the VSR API level for the device under test and ensure that the appropriate HAL version for the IRemotelyProvisionedComponent interface is present. E.g. a VSR 13 chipset should have IRPC v2 or newer. Bug: 251185719 Test: atest VtsHalRemotelyProvisionedComponentTargetTest Change-Id: I136cac27953d1d5acaa45510ad9efec2a75d8038 --- .../VtsRemotelyProvisionedComponentTests.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp index cb1c692df1..aebcf672ca 100644 --- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp +++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp @@ -783,4 +783,20 @@ TEST_P(CertificateRequestV2Test, NonEmptyRequest_testKeyInProdCert) { INSTANTIATE_REM_PROV_AIDL_TEST(CertificateRequestV2Test); +using VsrRequirementTest = VtsRemotelyProvisionedComponentTests; + +INSTANTIATE_REM_PROV_AIDL_TEST(VsrRequirementTest); + +TEST_P(VsrRequirementTest, VsrEnforcementTest) { + RpcHardwareInfo hwInfo; + ASSERT_TRUE(provisionable_->getHardwareInfo(&hwInfo).isOk()); + int vsr_api_level = get_vsr_api_level(); + if (vsr_api_level < 34) { + GTEST_SKIP() << "Applies only to VSR API level 34 or newer, this device is: " + << vsr_api_level; + } + EXPECT_GE(hwInfo.versionNumber, 3) + << "VSR 14+ requires IRemotelyProvisionedComponent v3 or newer."; +} + } // namespace aidl::android::hardware::security::keymint::test