Skip to content

Improvements to the attestation server: quote and Endorsement key serialized as TPMTPublic #925

@Foxboron

Description

@Foxboron

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

I think it would be practical if we could include a bit more information of the
client being attested.

I'm proposing two changes:

  • Include TPM2_Quote output into AttestationParameters
  • Change EKPub to TPMTPublic instead of crypto.PublicKey

The basic structs we have today is this:

type Attestation struct {
	TPMInfo      *TPMInfo               `json:"tpmInfo"`
	EKPub        []byte                 `json:"ek,omitempty"`
	EKCerts      [][]byte               `json:"ekCerts,omitempty"`
	AKCert       []byte                 `json:"akCert,omitempty"`
	AttestParams *AttestationParameters `json:"params"`
}

type AttestationParameters struct {
	Public                  []byte `json:"public,omitempty"`
	UseTCSDActivationFormat bool   `json:"useTCSDActivationFormat,omitempty"`
	CreateData              []byte `json:"createData,omitempty"`
	CreateAttestation       []byte `json:"createAttestation,omitempty"`
	CreateSignature         []byte `json:"createSignature,omitempty"`
}

I propose we add two new fields to AttestationParameters for QuoteAttestation and QuoteSignature.

type AttestationParameters struct {
	Public                  []byte `json:"public,omitempty"`
	UseTCSDActivationFormat bool   `json:"useTCSDActivationFormat,omitempty"`
	CreateData              []byte `json:"createData,omitempty"`
	CreateSignature         []byte `json:"createSignature,omitempty"`
	QuoteAttestation        []byte `json:"quoteAttestation,omitempty"`
	QuoteSignature          []byte `json:"quoteAttestation,omitempty"`
}

Where QuoteAttestation is TPM2B_ATTEST bytes, and QuoteSignature is
the TPMT_SIGNATURE bytes from the TPM2_Quote command, the signature should
be from the attestation key (AK) which is the Public field from
`AttestationParameters.

This would allow us to check against valid system states on the remote end.

Another change I would like is if we could move EKPub to not be a serialized
crypto.Publickey, but rather the actual TPMTPublic. go-tpm currently
implements a standardized KEM interface to help with credential activation in
the newer API, and this is based off on the TPMTPublic type.

See labeled_kem in go-tpm: https://github.com/google/go-tpm/blob/main/tpm2/labeled_kem_convert.go#L24

For this to be used on the remote end today with the current API structure you
need to make a bunch of assumptions around the symmetric paramteres and the name
algorithm being used. Which seems hacky when we could instead pass around the
actual public structure of the EK.

See attezt: https://github.com/Foxboron/attezt/blob/master/internal/attest/credential.go

(I could probably parse the EKCert instead.. but that is not a lot better?)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions