diff options
author | David Drysdale <drysdale@google.com> | 2022-03-21 15:21:32 +0000 |
---|---|---|
committer | David Drysdale <drysdale@google.com> | 2022-03-21 15:29:00 +0000 |
commit | 50a66b8f79a0342d6441e5e3842f284dd6fc5bca (patch) | |
tree | b7ce5f33b49117c55dd3ac76f0ac405bfb4d2c26 /security/keymint/aidl/vts/functional/AttestKeyTest.cpp | |
parent | b9fbe11dfe79f4ced9374ae7f1bc9cad6d241179 (diff) |
KeyMint VTS: strict test only for v2+
Bug: 223537775
Bug: 197096139
Test: VtsAidlKeyMintTargetTest
Change-Id: Ib77d52e4a91233c936b3a44f5eac71f53b2af450
Diffstat (limited to 'security/keymint/aidl/vts/functional/AttestKeyTest.cpp')
-rw-r--r-- | security/keymint/aidl/vts/functional/AttestKeyTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp index 8a26b3cffb..0bab54c2a6 100644 --- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp +++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp @@ -183,6 +183,14 @@ TEST_P(AttestKeyTest, AllRsaSizes) { * This test attempts to create an RSA attestation key that also allows signing. */ TEST_P(AttestKeyTest, RsaAttestKeyMultiPurposeFail) { + if (AidlVersion() < 2) { + // The KeyMint v1 spec required that KeyPurpose::ATTEST_KEY not be combined + // with other key purposes. However, this was not checked at the time + // so we can only be strict about checking this for implementations of KeyMint + // version 2 and above. + GTEST_SKIP() << "Single-purpose for KeyPurpose::ATTEST_KEY only strict since KeyMint v2"; + } + vector<uint8_t> attest_key_blob; vector<KeyCharacteristics> attest_key_characteristics; vector<Certificate> attest_key_cert_chain; @@ -453,6 +461,13 @@ TEST_P(AttestKeyTest, EcAttestKeyChaining) { * This test attempts to create an EC attestation key that also allows signing. */ TEST_P(AttestKeyTest, EcAttestKeyMultiPurposeFail) { + if (AidlVersion() < 2) { + // The KeyMint v1 spec required that KeyPurpose::ATTEST_KEY not be combined + // with other key purposes. However, this was not checked at the time + // so we can only be strict about checking this for implementations of KeyMint + // version 2 and above. + GTEST_SKIP() << "Single-purpose for KeyPurpose::ATTEST_KEY only strict since KeyMint v2"; + } vector<uint8_t> attest_key_blob; vector<KeyCharacteristics> attest_key_characteristics; vector<Certificate> attest_key_cert_chain; |