Skip to content

Question: Why does TPM integration sign PCR digests via SPDM MEASUREMENTS instead of TPM2_Quote #504

Description

@magickli1

Summary

I am integrating platform attestation with TPM as the Root of Trust on top of libspdm / spdm-emu and would like to understand the design intent behind the current TPM-backed measurement path.

Today, the TPM stub (spdm_device_secret_lib_tpm) appears to:

  1. Read PCR values via Esys_PCR_Read and place digests into GET_MEASUREMENTS.measurement_record[] as DMTF measurement blocks (libspdm_fill_measurement_image_hash_block() in meas.c).
  2. Sign the SPDM MEASUREMENTS transcript with the responder storage key (TPM_RESP_KEY) when SignatureRequested=1 (libspdm_generate_measurement_signature()libspdm_responder_data_sign()).
  3. Leave libspdm_measurement_opaque_data() as a placeholder (sequential bytes 0,1,2,...) with no TPM2_Quote, no IAK / attestation key, and no TPM2B_ATTEST in opaque_data.

Provisioning (setup-tpm.sh, keys.h) also defines only TPM_RESP_KEY / TPM_RESP_CERT_CHAIN (slot0), not a separate IAK for attestation.


Current vs expected behavior

What the code does today

Step Implementation File
PCR read libspdm_tpm_read_pcr()Esys_PCR_Read cryptlib_openssl/tpm/tpm.c
PCR in response DMTF blocks in measurement_record[] spdm_device_secret_lib_tpm/meas.c
MEASUREMENTS signature TPM_RESP_KEY signs SPDM L1/L2 transcript sign.c, libspdm_rsp_measurements.c
Opaque data Stub 0,1,2,...; no Quote meas.clibspdm_measurement_opaque_data()
IAK / attestation key Not provisioned keys.h, setup-tpm.sh

What I expected for TPM-rooted platform attestation

Evidence Suggested SPDM carrier
PCR digests GET_MEASUREMENTS.measurement_record[]
TPM2_Quote (TPM2B_ATTEST + TPMT_SIGNATURE) GET_MEASUREMENTS.opaque_data[] (e.g. OpaqueDataFmt1 + TCG element)
IAK certificate chain GET_CERTIFICATE slot1 (separate from device identity)
TCG Event Log (BIOS / IMA) GET_MEASUREMENT_EXTENSION_LOG.mel[]

Quote qualifying data would bind to GET_MEASUREMENTS request nonce[32], not the response nonce.

Important distinction: MEASUREMENTS.signature covers the SPDM transcript (device identity). TPM Quote should not replace that field; it attests PCR state via the TPM attestation key (IAK).


Questions for maintainers

  1. Was omitting TPM2_Quote intentional?
    Is the current model (“PCR in measurement_record + device key signs SPDM transcript”) considered sufficient for “TPM-backed measurements” in libspdm’s scope?

  2. Trust boundary
    Without Quote, how should a verifier distinguish:

    • PCR values read honestly from TPM, vs.
    • PCR digests assembled by untrusted firmware/software and signed only by the SPDM device key?
  3. SPDM field semantics
    Should TPM Quote live in MEASUREMENTS.opaque_data (not in signature)?
    Is there an upstream preference for SPDM_REGISTRY_ID_TCG + TPM2B_ATTEST || TPMT_SIGNATURE under OpaqueDataFmt1?

  4. Key separation
    Is there guidance on slot0 device identity key vs slot1 IAK for Quote verification?
    Or is reusing the same cert chain for all slots acceptable for the reference TPM stub?
    (Note: libspdm_read_responder_public_certificate_chain_per_slot() currently reads TPM_RESP_CERT_CHAIN regardless of slot_id.)

  5. Roadmap
    Are there existing issues, design notes, or planned work to add Quote / IAK / real Event Log to spdm_device_secret_lib_tpm?

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions