
Simple TPM Utility for Remote Attestation

Example 

1. Quote

1-0. Take the TPM ownwer ship

  $ tpm_takeownership
  Enter owner password: 
  Confirm password: 
  Enter SRK password: 
  Confirm password: 
 
  Note) Just enter for RSK password to set default auth.

1-1. Create RSA 2048-bit Sign Key just under SRK 
    and store in SYSTEM PS, with given UUID, without auth secret

  $ tpm_createkey -N -u 1448c61c6af7770fc4a3b413c1094e35

1-2. Issue TPM_Quote

  $ tpm_quote -N -u 1448c61c6af7770fc4a3b413c1094e35  -p 0 -p 2 -p 4 -p 8 -n 83c5cacb20a590e5b48980598cc69f18068495de
  pcrnums=24
  nonce=83c5cacb20a590e5b48980598cc69f18068495de
  pcr.0=130f8accf255c1e495bda46c1071e5401031afa6
  pcr.2=53de584dcef03f6a7dac1a240a835893896f218d
  pcr.4=7bd436270b52218cbdfa04330b4c802b81ccd792
  pcr.8=454af0c0b32c6acac693c75f9dc1339efdf103c0
  quoteinfo=0101000051554f5454cf5507c5b9dc9b894c4530311ba304aaba205a83c5cacb20a590e5b48980598cc69f18068495de
   
   

2. Extend PCR and Read PCR (with IMA)

2-1.  Extend

  # tpm_extend --file hoge 
  # tail /sys/kernel/security/ima/ascii_runtime_measurements 
  ...
  10 f73d086fcf5cba367f2a46c45c172c261517c474 /usr/bin/tpm_extend
  10 53b3d3711ef9ab14823aecbad54312bd464878ff /home/munetoh/workspace/tools/tpm/README
  10 8ad12dfaacb4fd032cdf8a5ded5c8c9c3faad171 /usr/bin/tail
  
   
2-2. PCR read

  $ tpm_pcrread -p 0 -p 2 -p 4 -p 10
  pcr.0=130f8accf255c1e495bda46c1071e5401031afa6
  pcr.2=53de584dcef03f6a7dac1a240a835893896f218d
  pcr.4=7bd436270b52218cbdfa04330b4c802b81ccd792
  pcr.10=e78c897488e60cb3b1080ee985cba20fcf701d68

3. Seal/Unseal (TBD)

3-1. Seal (use tpm-tools from TrouSerS)

  $ tpm_sealdata -i README -o README.sealed
  
3-2. Unseal

  $ tpm_unsealdata -i README.sealed -o README.plain
  $ diff README README.plain
  
  
