KeyMaster vts: Allow --dump_attestations to show whole DEVICE_UNIQUE_ATTESTATION

This debug option used to dump only leaf certificate.

Bug: 187803288
Change-Id: I6cd55597e5127f8aada3dc31ab3e81595f4affbf
This commit is contained in:
Tommy Chiu
2021-05-11 18:09:26 +08:00
parent 43ae2ecfe4
commit 566d1cb6e0

View File

@@ -243,7 +243,9 @@ TEST_P(DeviceUniqueAttestationTest, Rsa) {
EXPECT_EQ(ErrorCode::OK, result);
EXPECT_EQ(2U, cert_chain.size());
if (dumpAttestations) dumpContent(bin2hex(cert_chain[0]));
if (dumpAttestations) {
for (auto cert_ : cert_chain) dumpContent(bin2hex(cert_));
}
auto [err, attestation] = parse_attestation_record(cert_chain[0]);
ASSERT_EQ(ErrorCode::OK, err);
@@ -287,7 +289,9 @@ TEST_P(DeviceUniqueAttestationTest, Ecdsa) {
EXPECT_EQ(ErrorCode::OK, result);
EXPECT_EQ(2U, cert_chain.size());
if (dumpAttestations) dumpContent(bin2hex(cert_chain[0]));
if (dumpAttestations) {
for (auto cert_ : cert_chain) dumpContent(bin2hex(cert_));
}
auto [err, attestation] = parse_attestation_record(cert_chain[0]);
ASSERT_EQ(ErrorCode::OK, err);