diff options
Diffstat (limited to 'security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp')
-rw-r--r-- | security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp index d7abf0790c..6f2f189ab7 100644 --- a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp +++ b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp @@ -64,7 +64,9 @@ class DeviceUniqueAttestationTest : public KeyMintAidlTestBase { * attestation. */ TEST_P(DeviceUniqueAttestationTest, RsaNonStrongBoxUnimplemented) { - if (SecLevel() == SecurityLevel::STRONGBOX) return; + if (SecLevel() == SecurityLevel::STRONGBOX) { + GTEST_SKIP() << "Test not applicable to StrongBox device"; + } vector<uint8_t> key_blob; vector<KeyCharacteristics> key_characteristics; @@ -91,7 +93,9 @@ TEST_P(DeviceUniqueAttestationTest, RsaNonStrongBoxUnimplemented) { * attestation. */ TEST_P(DeviceUniqueAttestationTest, EcdsaNonStrongBoxUnimplemented) { - if (SecLevel() == SecurityLevel::STRONGBOX) return; + if (SecLevel() == SecurityLevel::STRONGBOX) { + GTEST_SKIP() << "Test not applicable to StrongBox device"; + } vector<uint8_t> key_blob; vector<KeyCharacteristics> key_characteristics; @@ -117,7 +121,9 @@ TEST_P(DeviceUniqueAttestationTest, EcdsaNonStrongBoxUnimplemented) { * attestation correctly, if implemented. */ TEST_P(DeviceUniqueAttestationTest, RsaDeviceUniqueAttestation) { - if (SecLevel() != SecurityLevel::STRONGBOX) return; + if (SecLevel() != SecurityLevel::STRONGBOX) { + GTEST_SKIP() << "Test not applicable to non-StrongBox device"; + } vector<uint8_t> key_blob; vector<KeyCharacteristics> key_characteristics; @@ -174,7 +180,9 @@ TEST_P(DeviceUniqueAttestationTest, RsaDeviceUniqueAttestation) { * attestation correctly, if implemented. */ TEST_P(DeviceUniqueAttestationTest, EcdsaDeviceUniqueAttestation) { - if (SecLevel() != SecurityLevel::STRONGBOX) return; + if (SecLevel() != SecurityLevel::STRONGBOX) { + GTEST_SKIP() << "Test not applicable to non-StrongBox device"; + } vector<uint8_t> key_blob; vector<KeyCharacteristics> key_characteristics; @@ -226,7 +234,9 @@ TEST_P(DeviceUniqueAttestationTest, EcdsaDeviceUniqueAttestation) { * local device. */ TEST_P(DeviceUniqueAttestationTest, EcdsaDeviceUniqueAttestationID) { - if (SecLevel() != SecurityLevel::STRONGBOX) return; + if (SecLevel() != SecurityLevel::STRONGBOX) { + GTEST_SKIP() << "Test not applicable to non-StrongBox device"; + } // Collection of valid attestation ID tags. auto attestation_id_tags = AuthorizationSetBuilder(); @@ -292,7 +302,9 @@ TEST_P(DeviceUniqueAttestationTest, EcdsaDeviceUniqueAttestationID) { * don't match the local device. */ TEST_P(DeviceUniqueAttestationTest, EcdsaDeviceUniqueAttestationMismatchID) { - if (SecLevel() != SecurityLevel::STRONGBOX) return; + if (SecLevel() != SecurityLevel::STRONGBOX) { + GTEST_SKIP() << "Test not applicable to non-StrongBox device"; + } // Collection of invalid attestation ID tags. auto attestation_id_tags = |