Merge "Update the TimeoutAuthenticationMultiSid test" into main am: d99d7730b8

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2676695

Change-Id: I6d58b87e43397544a6bc6f39412217176a1dfe94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-08-09 14:56:18 +00:00
committed by Automerger Merge Worker

View File

@@ -453,8 +453,18 @@ TEST_P(AuthTest, TimeoutAuthenticationMultiSid) {
vector<uint8_t> keyblob;
vector<KeyCharacteristics> key_characteristics;
vector<Certificate> cert_chain;
ASSERT_EQ(ErrorCode::OK,
GenerateKey(builder, std::nullopt, &keyblob, &key_characteristics, &cert_chain));
auto result = GenerateKey(builder, std::nullopt, &keyblob, &key_characteristics, &cert_chain);
if (SecLevel() == SecurityLevel::STRONGBOX) {
if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
result = GenerateKeyWithSelfSignedAttestKey(AuthorizationSetBuilder()
.EcdsaKey(EcCurve::P_256)
.AttestKey()
.SetDefaultValidity(),
builder, &keyblob, &key_characteristics,
&cert_chain);
}
}
ASSERT_EQ(ErrorCode::OK, result);
// Verify first user to get a HAT that should work.
const uint64_t challenge = 42;