TPM 2.0


OpenXT now supports TPM 2.0 hardware for Measured Launch.  The following page will serve as a reference for developers seeking to work with TPM 2.0 within OpenXT.

Sealing

In order to verify platform integrity and protect the config partition private key, we use the TPM to seal the key against a set of PCRs P {0,1,2,3,4,15,17,18,19}.  OpenXT does this by doing the following steps.

At install time:
1) Take ownership of the TPM for all hierarchies
2) Call tpm2_createprimary with the Owner hierarchy to derive a primary context from the Owner seed.
3) Call tpm2_evictcontrol on the context created in step 2 to convert it from a transient handle to a persistent handle
On First Boot:
4) Call tpm2_sealdata with the /config partition key as input, sealing against the above mentioned PCRs while the platform is in a known good state S.

After Upgrades:
4a) Precompute the values for a subset of P, (we'll call this set P') where P' is defined as PCRs {15, 17, 18, 19} for the next platform boot.
4b) Call tpm2_sealdata with these pre-computed values.

Unsealing

On Boot:
1) Call tpm2_unsealdata to retrieve the private key used to decrypt the /config partition.  The key will only unseal if the PCRs are in state S.


WIP...

Xen Summit 2017 slides