microsoft / ms-tpm-20-ref

Reference implementation of the TCG Trusted Platform Module 2.0 specification.
Other
337 stars 133 forks source link

Restore TPM state after shutdown #20

Closed mrcdb closed 5 years ago

mrcdb commented 5 years ago

Hi, I am unable to restore the TPM state when I restart a MS TPM instance, as the NVChip data file is always overwritten by the tpm_server command. This can be easily tested by persisting any data in the NVRAM and try access the handles after the restart. Am I missing something here?

EDIT: Regarding this issue, I see that the main body in TPMCmd/Simulator/src/TPMCmds.c always runs the TPM_Manufacture() function when you startup the tpm_server.

Does this mean that the platform is manufactured again at each start-up then? Does this imply that the states in NVChip are never restored ?

amarochk commented 5 years ago

Hi Marco, Yes, this is intentional behavior of the TPM 2.0 simulator application. Yet, this is not a mandatory functionality, and you are free to implement your front-end to the TPM 2.0 reference implementation in whatever way you like. The simulator behaves in this manner to facilitate recovery from failures and ensure reproducibility of test sessions. Please note that the TPM 2.0 power state changes are emulated via platform signals TPM_SIGNAL_POWER_ON/OFF and TPM_SIGNAL_RESET/RESTART, and do not require shutting down the simulator application. Best Regards,-Andrey Marochko

On Thursday, November 22, 2018, 1:51:37 PM GMT+3, Marco De Benedictis <notifications@github.com> wrote:  

Regarding this issue, I see that the main body in TPMCmd/Simulator/src/TPMCmds.c always runs the TPM_Manufacture() function when you startup the tpm_server.

Does this mean that the platform is manufactured again at each start-up then? Does this imply that the states in NVChip are never restored ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

lostzam commented 2 weeks ago

hi If I want the state and handles of the TPM to be saved after the simulator is closed, what should I do?