From 97272d8d5f16d64e98ed4b1e7096e24647f3939f Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Fri, 25 Aug 2023 07:27:28 +0100 Subject: [PATCH] KeyMint: fix auth test HAT The test case for an auth-per-operation HAT with an invalid HMAC is wrong -- it is re-using the previous HAT, which fails for a different reason (has an old challenge). Fix the test to use the HAT that's wrong in the intended way. Bug: 297333975 Test: VtsAidlKeyMintTargetTest Change-Id: I15fe9b0c1b53452df0f67dd44534fdb80a6c2a9c --- security/keymint/aidl/vts/functional/AuthTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keymint/aidl/vts/functional/AuthTest.cpp b/security/keymint/aidl/vts/functional/AuthTest.cpp index ecaee11f6f..d5c6d2aed2 100644 --- a/security/keymint/aidl/vts/functional/AuthTest.cpp +++ b/security/keymint/aidl/vts/functional/AuthTest.cpp @@ -545,7 +545,7 @@ TEST_P(AuthTest, AuthPerOperation) { ASSERT_GT(dodgy_hat->mac.size(), 0); dodgy_hat->mac[0] ^= 0x01; EXPECT_EQ(ErrorCode::KEY_USER_NOT_AUTHENTICATED, - Finish(message, {} /* signature */, &ciphertext, hat.value())); + Finish(message, {} /* signature */, &ciphertext, dodgy_hat.value())); } // Test use of a key that requires an auth token for each action on the operation, with