Merge "Fix RKP support assumptions for keymint VTS" am: f84593a459

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2469486

Change-Id: Ieade1cb739f09732305259446b84a477633d4a88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-03-14 22:16:17 +00:00 committed by Automerger Merge Worker
commit 298a35f967
3 changed files with 18 additions and 4 deletions

View file

@ -1292,6 +1292,19 @@ std::pair<ErrorCode, vector<uint8_t>> KeyMintAidlTestBase::UpgradeKey(
return retval;
}
bool KeyMintAidlTestBase::IsRkpSupportRequired() const {
if (get_vsr_api_level() >= __ANDROID_API_T__) {
return true;
}
if (get_vsr_api_level() >= __ANDROID_API_S__) {
return SecLevel() != SecurityLevel::STRONGBOX;
}
return false;
}
vector<uint32_t> KeyMintAidlTestBase::ValidKeySizes(Algorithm algorithm) {
switch (algorithm) {
case Algorithm::RSA:

View file

@ -309,6 +309,7 @@ class KeyMintAidlTestBase : public ::testing::TestWithParam<string> {
}
bool IsSecure() const { return securityLevel_ != SecurityLevel::SOFTWARE; }
SecurityLevel SecLevel() const { return securityLevel_; }
bool IsRkpSupportRequired() const;
vector<uint32_t> ValidKeySizes(Algorithm algorithm);
vector<uint32_t> InvalidKeySizes(Algorithm algorithm);

View file

@ -1136,8 +1136,8 @@ TEST_P(NewKeyGenerationTest, RsaWithAttestation) {
* that has been generated using an associate IRemotelyProvisionedComponent.
*/
TEST_P(NewKeyGenerationTest, RsaWithRkpAttestation) {
if (get_vsr_api_level() < __ANDROID_API_T__ || AidlVersion() < 2) {
GTEST_SKIP() << "Only required for VSR 12+ and KeyMint 2+";
if (!IsRkpSupportRequired()) {
GTEST_SKIP() << "RKP support is not required on this platform";
}
// There should be an IRemotelyProvisionedComponent instance associated with the KeyMint
@ -1214,8 +1214,8 @@ TEST_P(NewKeyGenerationTest, RsaWithRkpAttestation) {
* that has been generated using an associate IRemotelyProvisionedComponent.
*/
TEST_P(NewKeyGenerationTest, EcdsaWithRkpAttestation) {
if (get_vsr_api_level() < __ANDROID_API_T__ || AidlVersion() < 2) {
GTEST_SKIP() << "Only required for VSR 12+ and KeyMint 2+";
if (!IsRkpSupportRequired()) {
GTEST_SKIP() << "RKP support is not required on this platform";
}
// There should be an IRemotelyProvisionedComponent instance associated with the KeyMint