From 83691500e119f33b21a794d1d758a75ba7b02416 Mon Sep 17 00:00:00 2001 From: Tommy Chiu Date: Wed, 1 Apr 2020 14:47:40 +0800 Subject: [PATCH] Correct UseHmacKey parameter HMAC key was created with Digest(Digest::SHA_2_256) which is missing in the UseHmacKey function Bug: 152932473 Test: VtsHalKeymasterV4_1TargetTest Change-Id: If63dd197fe12172e14be9890ab07a00c3eef4a4c --- keymaster/4.1/vts/functional/Keymaster4_1HidlTest.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keymaster/4.1/vts/functional/Keymaster4_1HidlTest.h b/keymaster/4.1/vts/functional/Keymaster4_1HidlTest.h index 6332c43200..152c063951 100644 --- a/keymaster/4.1/vts/functional/Keymaster4_1HidlTest.h +++ b/keymaster/4.1/vts/functional/Keymaster4_1HidlTest.h @@ -115,7 +115,9 @@ class Keymaster4_1HidlTest : public V4_0::test::KeymasterHidlTest { ErrorCode UseHmacKey(const HidlBuf& hmacKeyBlob) { auto [result, mac, out_params] = ProcessMessage(hmacKeyBlob, KeyPurpose::SIGN, "1234567890123456", - AuthorizationSetBuilder().Authorization(TAG_MAC_LENGTH, 128)); + AuthorizationSetBuilder() + .Authorization(TAG_MAC_LENGTH, 128) + .Digest(Digest::SHA_2_256)); return result; }