From ed7e78db2315b6ba16da14c7b9cfc1f1ec56c8f0 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:42:06 +0200 Subject: [PATCH] fix verification report printing Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com> --- cli/internal/cmd/verify.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cli/internal/cmd/verify.go b/cli/internal/cmd/verify.go index c5517162f2..fc219890a3 100644 --- a/cli/internal/cmd/verify.go +++ b/cli/internal/cmd/verify.go @@ -428,6 +428,11 @@ func (f *attestationDocFormatterImpl) parseSNPReport(b *strings.Builder, reportB return fmt.Errorf("parsing signature: %w", err) } + signerInfo, err := abi.ParseSignerInfo(report.SignerInfo) + if err != nil { + return fmt.Errorf("parsing signer info: %w", err) + } + writeTCB := func(tcbVersion uint64) { tcb := kds.DecomposeTCBVersion(kds.TCBVersion(tcbVersion)) writeIndentfln(b, 3, "Secure Processor bootloader SVN: %d", tcb.BlSpl) @@ -459,12 +464,15 @@ func (f *attestationDocFormatterImpl) parseSNPReport(b *strings.Builder, reportB writeIndentfln(b, 2, "Platform Info:") writeIndentfln(b, 3, "Symmetric Multithreading enabled (SMT): %t", platformInfo.SMTEnabled) writeIndentfln(b, 3, "Transparent secure memory encryption (TSME): %t", platformInfo.TSMEEnabled) - writeIndentfln(b, 2, "Author Key ID: %x", report.SignerInfo) + writeIndentfln(b, 2, "Signer Info:") + writeIndentfln(b, 3, "Author Key Enabled: %t", signerInfo.AuthorKeyEn) + writeIndentfln(b, 3, "Chip ID Masking: %t", signerInfo.MaskChipKey) + writeIndentfln(b, 3, "Signing Type: %s", signerInfo.SigningKey) writeIndentfln(b, 2, "Report Data: %x", report.ReportData) writeIndentfln(b, 2, "Measurement: %x", report.Measurement) writeIndentfln(b, 2, "Host Data: %x", report.HostData) writeIndentfln(b, 2, "ID Key Digest: %x", report.IdKeyDigest) - writeIndentfln(b, 2, "Author Key Digest: %t", ((report.SignerInfo & 1) != 0)) + writeIndentfln(b, 2, "Author Key Digest: %x", report.AuthorKeyDigest) writeIndentfln(b, 2, "Report ID: %x", report.ReportId) writeIndentfln(b, 2, "Report ID MA: %x", report.ReportIdMa) writeIndentfln(b, 2, "Reported TCB:")