summaryrefslogtreecommitdiff
path: root/security/keymint/aidl/vts/functional/KeyMintTest.cpp
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2021-08-02 12:28:42 -0600
committerShawn Willden <swillden@google.com>2021-08-12 22:47:34 +0000
commit9a7410e50d685af61ac170a48d1c87dc902e4e97 (patch)
tree4fc9fe70b30db8a4a6292f41b0f6a221de821c3f /security/keymint/aidl/vts/functional/KeyMintTest.cpp
parent38fe3c5962a451cfc552f0a23572b10c147ca0df (diff)
Fix KeyDeletionTest.DeleteAllKeys
Test failed to set default key validity, which caused keygen to fail. Wasn't noticed because this test is typically disarmed. Note: This test will destroy all user data on the device (which is why it is typically disarmed). Bug: 187105270 Test: VtsAidlKeyMintTargetTest --arm_deleteAllKeys Change-Id: I67e317fdfca15c95c6420918948d1416e97de482 Merged-In: I67e317fdfca15c95c6420918948d1416e97de482
Diffstat (limited to 'security/keymint/aidl/vts/functional/KeyMintTest.cpp')
-rw-r--r--security/keymint/aidl/vts/functional/KeyMintTest.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index b695deec5d..931317fad2 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -3271,10 +3271,10 @@ TEST_P(ImportKeyTest, AesFailure) {
for (uint32_t key_size : {bitlen - 1, bitlen + 1, bitlen - 8, bitlen + 8}) {
// Explicit key size doesn't match that of the provided key.
auto result = ImportKey(AuthorizationSetBuilder()
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .AesEncryptionKey(key_size)
- .EcbMode()
- .Padding(PaddingMode::PKCS7),
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .AesEncryptionKey(key_size)
+ .EcbMode()
+ .Padding(PaddingMode::PKCS7),
KeyFormat::RAW, key);
ASSERT_TRUE(result == ErrorCode::IMPORT_PARAMETER_MISMATCH ||
result == ErrorCode::UNSUPPORTED_KEY_SIZE)
@@ -3338,10 +3338,10 @@ TEST_P(ImportKeyTest, TripleDesFailure) {
for (uint32_t key_size : {bitlen - 1, bitlen + 1, bitlen - 8, bitlen + 8}) {
// Explicit key size doesn't match that of the provided key.
auto result = ImportKey(AuthorizationSetBuilder()
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .TripleDesEncryptionKey(key_size)
- .EcbMode()
- .Padding(PaddingMode::PKCS7),
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .TripleDesEncryptionKey(key_size)
+ .EcbMode()
+ .Padding(PaddingMode::PKCS7),
KeyFormat::RAW, key);
ASSERT_TRUE(result == ErrorCode::IMPORT_PARAMETER_MISMATCH ||
result == ErrorCode::UNSUPPORTED_KEY_SIZE)
@@ -6203,7 +6203,8 @@ TEST_P(KeyDeletionTest, DeleteAllKeys) {
.Digest(Digest::NONE)
.Padding(PaddingMode::NONE)
.Authorization(TAG_NO_AUTH_REQUIRED)
- .Authorization(TAG_ROLLBACK_RESISTANCE));
+ .Authorization(TAG_ROLLBACK_RESISTANCE)
+ .SetDefaultValidity());
ASSERT_TRUE(error == ErrorCode::ROLLBACK_RESISTANCE_UNAVAILABLE || error == ErrorCode::OK);
// Delete must work if rollback protection is implemented