tpm2-software / tpm2-tools

The source repository for the Trusted Platform Module (TPM2.0) tools
https://tpm2-software.github.io
725 stars 380 forks source link

TPM2 integrity check failed #3222

Open KyleKang0603 opened 1 year ago

KyleKang0603 commented 1 year ago

I ran into error below when I reboot and decrypt

My sequence was as below

  1. tpm2_createprimary -c primary.ctx
  2. tpm2_create -C primary.ctx -u a.pub -r b.priv
  3. tpm2_load -C primary.ctx -u a.pub -r b.priv -c [Handler]
  4. tpm2_rsaencrypt -c [Handler] -o [Encrypted] [Key]
  5. reboot
  6. tpm2_rsadecrypt -c [Handler] -o [Key] [Encrypted] and I encountered this error
    WARNING:esys:src/tss2-esys/api/Esys_ContextLoad.c:279:Esys_ContextLoad_Finish() Received TPM Error 
    ERROR:esys:src/tss2-esys/api/Esys_ContextLoad.c:93:Esys_ContextLoad() Esys Finish ErrorCode (0x000001df) 
    ERROR: Esys_ContextLoad(0x1DF) - tpm:parameter(1):integrity check failed
    ERROR: Unable to run tpm2_load

    if I restart service step 6 works, but if I reboot it failed as above. Am I missing something?

JuergenReppSIT commented 1 year ago

After a reboot you must recreate the context files.