Skip to content

Conversation

@hyperfinitism
Copy link

What's changed

  • Add tools/show/show.go: a CLI tool show that reads a TDX quote (in binary, proto, or textproto format), parses it into a tdx.QuoteV4 protobuf, and writes it out in the requested format (currently only textproto is supported).
    • Parsing logic is imported from tools/check/check.go
    • Writing logic is imported from tools/attest/attest.go
  • Add tools/show/README.md: documents the tool's purpose, flags, defaults, and usage, matching the style of other CLI tools in the repo.

Test

Environment

  • VM: Google Compute Engine C3
  • OS: Ubuntu 24.04
  • Kernel: 6.14.0-1017-gcp
  • Go: 1.22.2

bin→textproto

sudo ./attest -in deadbeef -inform hex -out quote.bin -outform bin
./show -in quote.bin -inform bin -outform textproto -out quote-bin-to-textproto.txt
cat ./quote-bin-to-textproto.txt

textproto→textproto

sudo ./attest -in deadbeef -inform hex -out quote.txt -outform textproto
./show -in quote.txt -inform textproto -outform textproto -out quote-textproto-to-textproto.txt
cat ./quote-textproto-to-textproto.txt

bin→textproto (stdout)

sudo ./attest -in deadbeef -inform hex -out quote.bin -outform bin
./show -in quote.bin -inform bin -outform textproto

Each script results:

header:  {
  version:  4
  attestation_key_type:  2
  tee_type:  129
  qe_svn:  "\x00\x00"
  pce_svn:  "\x00\x00"
  qe_vendor_id:  "\x93\x9ar3\xf7\x9cL\xa9\x94\n\r\xb3\x95\x7f\x06\x07"
  user_data:  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
}
td_quote_body:  {
  ...

@google-cla
Copy link

google-cla bot commented Nov 9, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

- Add tools/show/show.go: a standalone main package that reads a TDX quote
  (binary, proto, or textproto), parses it into a `tdx.QuoteV4` protobuf, and
  writes it out in the requested format (currently only "textproto" is supported).
  - Parsing logic is imported from tools/check/check.go
  - Writing logic is imported from tools/attest/attest.go
- Add tools/show/README.md: documents the tool's purpose, flags, defaults, and
  usage, matching the style of other CLI tools in the repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant