summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommy Chiu <tommychiu@google.com>2021-05-11 18:09:26 +0800
committerTommy Chiu <tommychiu@google.com>2021-05-12 18:04:19 +0800
commit566d1cb6e0eb2c1da8f11d3f850135d7d5f13dba (patch)
treeabb0c9369a9bd9c9a0fcaccc06bdd39c9834676d
parent43ae2ecfe4e97113d5d2a86191e89af24ea5210f (diff)
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
-rw-r--r--keymaster/4.1/vts/functional/DeviceUniqueAttestationTest.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/keymaster/4.1/vts/functional/DeviceUniqueAttestationTest.cpp b/keymaster/4.1/vts/functional/DeviceUniqueAttestationTest.cpp
index e46cb4868d..0639da8ab1 100644
--- a/keymaster/4.1/vts/functional/DeviceUniqueAttestationTest.cpp
+++ b/keymaster/4.1/vts/functional/DeviceUniqueAttestationTest.cpp
@@ -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);