tpm2: implement locking firmware rollback counter

TPM1.2 is using the somewhat misnamed tlcl_set_global_lock() command
function to lock the hardware rollback counter. For TPM2 let's
implement and use the TPM2 command to lock an NV Ram location
(TPM2_NV_WriteLock).

BRANCH=none
BUG=chrome-os-partner:50645
TEST=verified that TPM2_NV_WriteLock command is invoked before RO
     firmware starts RW, and succeeds.

Change-Id: I62f22b9991522d4309cccc44180a5ebd4dca488d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358097
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
This commit is contained in:
Vadim Bendebury 2016-07-03 17:08:10 -07:00 committed by chrome-bot
commit 2f859335df
5 changed files with 49 additions and 17 deletions

View file

@ -135,6 +135,11 @@ uint32_t tlcl_get_flags(uint8_t *disable, uint8_t *deactivated,
*/
uint32_t tlcl_set_global_lock(void);
/**
* Make an NV Ram location read_only. The TPM error code is returned.
*/
uint32_t tlcl_lock_nv_write(uint32_t index);
/**
* Perform a TPM_Extend.
*/